Sending an email via AppleScript and Dialogue Boxes

I am trying to write a script to send an email via Mail of which the body of the message is from a dialogue box. I decided upon using Automator and AppleScript. I have, so far, the following workflow:
1. Run Apple Script:
set mypass to text returned of (display dialog "What are you doing?" with icon 1 buttons {"Tweet", "Cancel"} default button "Tweet" default answer "")
2. New Mail Message.
3. Send Outgoing Messages.
4. Run Apple Script:
on run {input, parameters}
tell application "System Events" to set visible of process "Mail" to false
return input
end run
I wand this workflow to allow the user to input an answer and this answer to be in the message field of the email. I can use the "Ask for Text" action in Automator but it does not allow for any control over the appearance of the dialogue box. The first script returns the result "<whatever is typed>" (ie. "Test") in the Results field below the script box, as does the "Ask for Text" action but it does not insert it into the message. Does anyone know what is going wrong here?
I am relatively new to AppleScript which is why I am using Automator but would like any information on how this could be done entirely in AppleScript. My previous attempts at sending email using script was unsuccessful.
My aim is to save this as an Application with a proper icon.

see my reply to your post in the snow leopard forum.
http://discussions.apple.com/thread.jspa?messageID=10318297&#10318297

Similar Messages

  • Calendar triggered sending of emails via AppleScript / AutoMator

    Let us say that I have groups defined in my Contacts app.
    I want an AppleScript / Automator workflow that will send a predefined text (with placeholders for first name) a predefined number of hours (say 12 hours) before a calendar event / date (say Thanksgiving) one by one to each person in a specified group.
    I guess I could spend a few hours building this, but it sounds like something someone must have done before.
    Any pointers?
    Thanks.

    Sorted it. I need to change addRecipient to setRecipient.

  • Unable to send out emails via outlook express since 06/29/2010

    Task '[email protected]" - Sending' reported error (0x80042109) : 'Outlook is unable to connect to your outgoing (SMTP) e-mail server. If you continue to receive this message, contact your server administrator or Internet service provider (ISP).'        This is a copy/paste of error message from Office Outlook  2003
    Our household has been unable to "send" outgoing emails since 06/29/2010.  This includes a wireless laptop and a PC. We both lost the ability to send emails same day.  We changed NOTHING and did not share emails with each other that would have corrupted our system. During this time I have had 2 Verizon techs dance around in the PC doing all the same things I did as well as what  the automated assistant did.  The last tech said the Outlook Express 6.0 was corrupted, and to unistall it and then reinstall;  this time 2 hours later, I think he just gave up).  That did not work either.  I tried using the Outlook Office and still got an error message for outging. Everything is set up as it was when it was working until 06/29/2010.  I was told that there was a new server being installed and that things wold be working by 07/02/2010... I have tried taking down the firewall, turning off virus protection (McAfee), changing from outgoing.yahoo.verizon.net to just outgoing.verizon.net, checking boxes, unchecked boxes. SMPT is set to 587.  We get incoming fine.  I hate using the "Verizon email site" as too much monkey motion to get to mail, but that's what we have been doing.  I even tried setting up a GMail account, again got mail still could not send.  Any ideas?

    Thank you for your response!  I even tried sending an email via dos prompt  with Telnet, got past "HELO", but when trying to get a  "RCPT TO"  (using outgoing.yahoo.verizon.net)  I got an "authorization required" response and then was dropped.  I have been passed around without a solution. I am about ready to change ISP, but really hate to as most of the time (years now) this has been a decent ISP. If Verizon is having a problem just say so, I can handle it, honesty would be nice, refreshing and not wasting so much of my time as well as the techs!

  • Sending external email via SAPCONNECT

    Hi all,
    I want to know how to send external email through sap.
    Thanks in advance,
    Manosh.

    HI,
    Try this  code:
    *& Report  ZSENDEMAIL                                                  *
    *& Example of sending external email via SAPCONNECT                    *
    REPORT  zsendemail                    .
    PARAMETERS: psubject(40) type c default  'Hello',
                p_email(40)   type c default '[email protected]' .
    data:   it_packing_list like sopcklsti1 occurs 0 with header line,
            it_contents like solisti1 occurs 0 with header line,
            it_receivers like somlreci1 occurs 0 with header line,
            it_attachment like solisti1 occurs 0 with header line,
            gd_cnt type i,
            gd_sent_all(1) type c,
            gd_doc_data like sodocchgi1,
            gd_error type sy-subrc.
    data:   it_message type standard table of SOLISTI1 initial size 0
                    with header line.
    *START-OF-SELECTION.
    START-OF-SELECTION.
    Perform populate_message_table.
    *Send email message, although is not sent from SAP until mail send
    *program has been executed(rsconn01)
    PERFORM send_email_message.
    *Instructs mail send program for SAPCONNECT to send email(rsconn01)
    perform initiate_mail_execute_program.
    *&      Form  POPULATE_MESSAGE_TABLE
          Adds text to email text table
    form populate_message_table.
      Append 'Email line 1' to it_message.
      Append 'Email line 2' to it_message.
      Append 'Email line 3' to it_message.
      Append 'Email line 4' to it_message.
    endform.                    " POPULATE_MESSAGE_TABLE
    *&      Form  SEND_EMAIL_MESSAGE
          Send email message
    form send_email_message.
    Fill the document data.
      gd_doc_data-doc_size = 1.
    Populate the subject/generic message attributes
      gd_doc_data-obj_langu = sy-langu.
      gd_doc_data-obj_name  = 'SAPRPT'.
      gd_doc_data-obj_descr = psubject.
      gd_doc_data-sensitivty = 'F'.
    Describe the body of the message
      clear it_packing_list.
      refresh it_packing_list.
      it_packing_list-transf_bin = space.
      it_packing_list-head_start = 1.
      it_packing_list-head_num = 0.
      it_packing_list-body_start = 1.
      describe table it_message lines it_packing_list-body_num.
      it_packing_list-doc_type = 'RAW'.
      append it_packing_list.
    Add the recipients email address
      clear it_receivers.
      refresh it_receivers.
      it_receivers-receiver = p_email.
      it_receivers-rec_type = 'U'.
      it_receivers-com_type = 'INT'.
      it_receivers-notif_del = 'X'.
      it_receivers-notif_ndel = 'X'.
      append it_receivers.
    Call the FM to post the message to SAPMAIL
      call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
           exporting
                document_data              = gd_doc_data
                put_in_outbox              = 'X'
           importing
                sent_to_all                = gd_sent_all
           tables
                packing_list               = it_packing_list
                contents_txt               = it_message
                receivers                  = it_receivers
           exceptions
                too_many_receivers         = 1
                document_not_sent          = 2
                document_type_not_exist    = 3
                operation_no_authorization = 4
                parameter_error            = 5
                x_error                    = 6
                enqueue_error              = 7
                others                     = 8.
    Store function module return code
      gd_error = sy-subrc.
    Get it_receivers return code
      loop at it_receivers.
      endloop.
    endform.                    " SEND_EMAIL_MESSAGE
    *&      Form  INITIATE_MAIL_EXECUTE_PROGRAM
          Instructs mail send program for SAPCONNECT to send email.
    form initiate_mail_execute_program.
      wait up to 2 seconds.
      if gd_error eq 0.
          submit rsconn01 with mode = 'INT'
                        with output = 'X'
                        and return.
      endif.
    endform.                    " INITIATE_MAIL_EXECUTE_PROGRAM
    Reward points if found helpful....
    Cheers,
    Chandra Sekhar.

  • Using launchd to send an email on startup and shutdown

    Hello All !
    I'd like to get an email whenever my Mac starts up and shuts down, since I have to leave it unattended for quite some long periods of time (and even with the help of a UPS, power goes out anyway...). My Mac runs under Mac OS X Lion.
    I found some help on the Internet, mainly from this page : http://www.syntaxtechnology.com/2009/06/email-on-shutdown-and-restart/ , which applies to Linux, and hoped it could work on Mac OS X (I thought at first I could just drop a script in something like /etc/init.d/ or /etc/rc.d/rc5.d but well... we have launchd instead...).
    The first method listed in the page above worked well, but sends an email only on startup (for a reminder: you add a line that starts with @reboot in your crontab, and a command that sends directly an email).
    I then tried to adapt the second method to Mac OS X, and succeeded partially: I wrote a small script based on what was shown on that page (a start and stop function, start gets called when the script is started, and stop gets called based on a trap on various kill signals, with an infinite wait loop: see below). I also wrote the plist file, loaded it in launchd and rebooted my Mac several times to test everything.
    I get an email on each startup (yeah!), but the shutdown mail gets sent only at the next startup. So I guess that postfix gets killed by the shutdown process *before* being able to send my shutdown email :-(
    So here are my main questions, if someone can help me:
    1. is there a way to precisely call a script during the shutdown process, meaning giving it a priority so it gets called before postfix dies ? (like the rc directories and the naming conventions (KnnScriptName and SnnScriptName) found on some Linux/Unix).
    2. is it possible to do that with launchd ? if not, what would be the Mac OS X sanctionned way of doing this ?
    Other things:
    3. my shell script writing ability is kind of rusty, so maybe I made some "very bad shell writingTM": l'm not sure putting an infinite while loop with a 15 second pause in it is the best way of telling a script to do nothing. There might other things in there that would make an Unix guru jump out of his chair: please tell me :-)
    This is my plist:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC “-//Apple Computer//DTD PLIST 1.0//EN” “http://www.apple.com/DTDs/PropertyList-1.0.dtd”>
    <plist version=“1.0”>
    <dict>
    <key>Disabled</key>
    <false/>
    <key>Label</key><string>org.amarante.startshutemail</string>
    <key>ProgramArguments</key>
    <array>
    <string>/Library/Scripts/startshutemail-launchd.sh</string>
    <string>start</string>
    </array>
    <key>RunAtLoad</key><true/>
    </dict>
    </plist>
    And this is the script that does the job:
    #!/bin/bash
    # PHL 20120604 startshutemail-launchd.sh
    # Send an email on startup and shutdown (version for launchd)
    # Based on script and explanations found here:
    # http://www.syntaxtechnology.com/2009/06/email-on-shutdown-and-restart/
    # Modification history
    # PHL 20120604 v01 First version
    # Environment variables #################################################
    DEST_EMAIL="[email protected]"
    SRV_NAME=Amarante
    EVENT_TIME=$(date +%Y/%m/%d-%H:%M:%S)
    RESTART_SUBJECT="[$SRV_NAME] $EVENT_TIME : System Startup"
    RESTART_BODY="This is an automated message to notify you that $SRV_NAME started successfully at $EVENT_TIME."
    SHUTDOWN_SUBJECT="[$SRV_NAME] $EVENT_TIME : System Shutdown"
    SHUTDOWN_BODY="This is an automated message to notify you that $SRV_NAME is shutting down now ($EVENT_TIME)."
    # Functions ##########
    stop()
    echo "$SHUTDOWN_BODY" | mail -s "$SHUTDOWN_SUBJECT" $DEST_EMAIL
    return 0
    start()
    echo "$RESTART_BODY" | mail -s "$RESTART_SUBJECT" $DEST_EMAIL
    return 0
    # Main part #########
    case $1 in
    stop)
    stop
    start)
    start
    esac
    # trap kill signals to send an email
    trap stop HUP INT QUIT ABRT KILL ALRM TERM TSTP
    # sleep until killed
    while :
      do
        sleep 15
      done
    Thanks for your help, and any comment :-)
    Paul-Henri

    Thanks a lot for your answer, Camelot, even if it sorts of confirm what I suspected. Pinging a machine from an external observer is a solution, but it will also report broken links problems and not only a computer shutting down, and it raises the next tier of problems, general network reliability after individual system reliability. It's something I'll have to look at for sure.
    It's weird there isn't any way to access the way the shutdown process works.
    One of the commenters (#14) on the page from Syntaxtechnology had a similar problem: he added a "sendmail -q" in his script to force sendmail to go to work and service the queue before shutting down, which I can try, but he also added a delay to the stop process of sendmail, which is something I'm not sure I can do on Mac OS X (and that might disappear one day with one of the OS updates).
    Unless there is a way to change the launchd.plist file for postfix and add an ExitTimeOut option in it (I found this idea here : https://discussions.apple.com/message/17229690#17229690 )
    Cheers,
    Paul-Henri

  • I have an old Mac G5 with OSX 10.5.8  After a crash of my HD, I reinstalled the CS3. At the time of recording I get a window with the message "COMPLETED REGISTRATION" and under "There was a problem sending the informasioni via internet" and still under th

    I have an old Mac G5 with OSX 10.5.8
    After a crash of my HD, I reinstalled the CS3.
    At the time of recording I get a window with the message "COMPLETED REGISTRATION" and under "There was a problem sending the informasioni via internet" and still under three choices to "send back" and "records in a second time "or" never record "and I continue to choose the latter option.
    Another problem is that in Bridge (version 2.0.0.975) I can no longer see thumbnails of RAW files from my Canon 40D that I saw before.
    Should I upgrade ACR? which is the latest version supported on my Mac?
    thank you

    Sergio Bellotto if you keep receiving the registration screen then please try accepting the screen in a different User account.

  • I am trying to send an email to myself and BCC everyone in my address, but have forgotten how. Can someone help me with this?

    I am trying to send an email to myself and bcc everyone in my address book, but have forgotten how. Can anyone help me with this? Thanks.

    http://chrisramsden.vfast.co.uk/7_How_do_I_send_to_everyone.html

  • Hi, my friend have been sending me songs via whatassps and i have downloaded in my iphone 6  but i couldnt find all those download songs. please help

    Hi, my friend have been sending me songs via Whatassps and i have downloaded in my iPhone 6  but i couldn't find all those download songs. Please help. Thanks.

    music can only be installed and listened to either via iTunes on your computer or by downloading from the iTunes Store, so stop wasting your time with other methods.

  • I cant send an email via UTL_MAIL : ERROR NO 530

    hi .. i want to send an email via UTL_MAIL package. I am using ORACLE XE 10g.
    I am trying this code :
    declare
    i INTEGER;
    BEGIN
    UTL_MAIL.send('[email protected]','[email protected]',NULL,NULL,'DENEMEKONU','DENEMEMESAJ',NULL,NULL);
    END;
    then, i encounter this error:
    ORA-29279: SMTP permanent error: 530 5.7.0 Must issue a STARTTLS command first.....
    I made settings of smtp mail with:
    ALTER SYSTEM SET SMTP_OUT_SERVER='smtp.gmail.com';
    But i am getting this error consistently.
    How can i solve this problem, thanx.

    Hello Kadir,
    any errors, NDRs, logs that you could provide? How do you know the messages are not getting trough to that address?
    Regards,
    Andreas

  • How do i send an email to addressee and receive back a confirmation that the addressee received my email?

    how do i send an email to addressee and receive back a confirmation that the addressee received my email?

    Even if you find a way to send the request for a read confirmation with the email, you are dependent on the recipient's mail system and/or mail reading software to notice it and comply with it. Many do not do so, either because they cannot or because somebody has disabled (or not enabled) the feature.

  • When I send an email with attachments and open them on my ipad some of them open but others do not

    When I send an email with attachments and open them on my ipad some of them open but others do not

    What are the types that won't open?
    Do you have an App that can open those types of files?

  • I am trying to "pin" to pinterest through a dialogue box and nothing happens when I hit "pin" and I also tried to send a message through linked in dialogue box and nothing happens when I hit "send"

    Why does nothing happen when I'm trying to perform an action/command through a pop-up dialogue box, such as sending a message on linkedin or attempting to pin on pinterest?

    All future installs/updates of Muse (and most other Adobe apps) are through the Creative Cloud desktop app. Thus you do need to have it installed.
    Are you on Windows or Mac? What OS version?

  • Sending Duplicate emails using Mail and mBox for mac

    I have been sending duplicate emails inadvertantly recently.  It seems it's when I use mBox for mac (registered copy) in Mail to use my Hotmail with IMAP.
    I hadn't noticed it at first, but now I see everytime I send a mail I get 2 copies in my sent box.  I can turn off the store sent messages on server option to fix it (but that's the whole point of having IMAP!!), or I can turn off mBox for mac and it also seems to work (but then I can't use IMAP!).    I've also tried on the same machine from gmail, and iCloud accounts (MobileMe), and I had no issue at all.  I've also tried 2 different Hotmail accounts, and both of them send double messages every time I send. 
    I've searched for a loooooong time, and can't find anyone with a similar issue - but surely I'm not the only one?  I think anyone still using a hotmail account will eventually install something like mBox for mac if they've gone Mac recently - as I have.
    I checked the mail headers of the 2 mails, and they are quite different (masked where appropriate) -
    Mail 1 -
              From:   xxxxx <[email protected]>
              Subject:           Test 19th
              Date:           May 29, 2012 12:06:19 AM GMT+08:00
              To:   yyyyy <[email protected]>
      Content-Type:           text/plain
      Content-Transfer-Encoding:           7bit
              X-Smtp-Server:           smtp.live.com:[email protected]
              X-Universally-Unique-Identifier:           fb14cd4f-e68c-43fa-8d0b-950df8394fde
              Message-Id:           <[email protected]>
              Mime-Version:           1.0 (Apple Message framework v1278)
    Mail 2 -
              From:   xxxxx <[email protected]>
              Subject:           Test 19th
              Date:           May 29, 2012 12:06:19 AM GMT+08:00
              To:   yyyyy <[email protected]>
              X-Originating-Ip:           [zzz.zzz.zzz.zzz]
              X-Originating-Email:           [[email protected]]
              Message-Id:           <[email protected]>
              Received:           from [192.168.1.52] ([zzz.zzz.zzz.zzz]) by BLU0-SMTP71.phx.gbl over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Mon, 28 May 2012 09:06:21 -0700
      Content-Type:           text/plain
      Content-Transfer-Encoding:           7bit
              Mime-Version:           1.0 (Apple Message framework v1278)
              X-Mailer:           Apple Mail (2.1278)
              X-Originalarrivaltime:           28 May 2012 16:06:21.0350 (UTC) FILETIME=[D2B26460:01CD3CEB]
    I'm surprised I can't find anyone else with a similar issue.  I've submitted a support ticket with mBox/fluent factory, but I'm still not convinced it's their issue, and possibly a Mail on Mac issue.
    Does anybody have any suggestions?  Thanks for your help!

    @ Kokola
    Great staff!!! MBox Fluent Factory is very poor app.
    I was having problem with duplicated sent emails and cleaning up my inbox, sent items and deleting emails. Try to contact them via email for over 3 months and never got a reply!
    I just used the suggested configuration and my Entourage (email app for MAC) is working perfetcly. I can visualise all my online folders now!
    Thank you so much!
    mBox never addressed the issue and the duplicated emails reached new levels of annoyance but the good thing is that Hotmail and Outlook.com finally rolled out support for IMAP.
    Incoming Mail Server: imap-mail.outlook.com
    Outgoing Mail Server: smtp-mail.outlook.com
    http://windows.microsoft.com/en-us/windows/outlook/send-receive-from-app
    No more duplication issues once you switch over, and no need for a third party (mBox)software to bridge the missing feature gap.

  • Sending an email via alternative SMTP

    Hi, up until recently Mail would politely prompt me to choose an alternate SMTP setting if I had sent an email using a non-available server setting. Example:
    When at home my ISP requires me to use smtp.johndoe.com but when at work I use their relay settings, so instead of having to remember which one to use Mail used to come up with a dialogue box and I could select the appropriate one. For some bizarre reason that service just stopped.
    Now, any mail sent using the wrong setting doesn't get flagged, it just sits in the mail out folder..
    Any ideas anyone? thanks

    The problem seems to be that the result of the first "run apple script action" is in a slightly different format than the "new mail message" action wants even though it's text. I don't know how to coerce it to the correct format from the "run apple script" action itself (it should be possible though) but an easy way around is to add a dummy "run shell script action which will do nothing but convert it to the correct format.
    so change the beginning of your workflow like this
    1. run apple script
    <pre style="
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    margin: 0px;
    padding: 5px;
    border: 1px solid #000000;
    width: 720px;
    color: #000000;
    background-color: #ADD8E6;
    overflow: auto;"
    title="this text can be pasted into the Script Editor">
    on run {input, parameters}
    set mypass to text returned of (display dialog "What are you doing?" with icon 1 buttons {"Tweet", "Cancel"} default button "Tweet" default answer "")
    end run</pre>
    2. run shell script
    just add this action and keep it in the default form "cat". don't change anything in it.
    3. new mail message.
    Message was edited by: V.K.

  • Freezing and dialogue box requesting restart

    in the last month several times my screen freezes{always during the screen saver mode}. some of the time i was downloading a movie but it has happened when the screen saver goes into action approx. 5 minutes before the sleep mode.
    then appears a translucent dialogue box in several languages telling me to press and hold the power button for restart.
    seems to be connected to the screen saver mode, any suggestions?
    thanx
    safed

    The document at http://docs.info.apple.com/article.html?artnum=25704 explains that this error results from a missing file (BaseSystem.pkg) is missing from your >library>receipts folder.
    That document also suggests it may have been moved, so first off, try and search for it in the Finder's Edit menu 'Find' command. If you locate it elsewhere on the system, move it back to the library/receipts folder. If it's not found on your system, you can copy it from another Mac running a similar version of MacOS (it doesn't have to be exactly the same version). It's about 2Mb in size so it can even be emailed to you from someone who has a suitable copy.
    Alternatively, as the document suggests, you can reinstall MacOS from your install disk. Use 'archive and install' to ensure you don't damage your data, and then bring the system back up to date, preferably by downloading the combo updater rather than System Updates.
    You may be able to extract a copy of BaseSystem.pkg from your install disk using Pacifist by the way. I've not tried this, but it may be worth a try if you are otherwise facing a reinstall.

Maybe you are looking for

  • How to look for kMAT material in Testing client?

    Hi PP members: How to look for KMAT material in Test client, Note: I went to mm60 and entered material type: KMAT it did not populate any materials Is there any way where I can find the materials, If yes please let me know thanks Suren

  • ProgressMonitor problem

    hi, I have small problem with ProgressMonitor. This is how I create it: progressMonitor = new ProgressMonitor(guiPool.getMainFrame(), message, note, 0, mediaIds.size()); progressMonitor.setProgress(0); progressMonitor.setMillisToPopup(100); progressM

  • Error getting list of users

    Hi All, I have a  transaction for getting the list of users and sending mail to them. I have used XML query to get the list of users using the following URL: "http://<server:port>/XMII/Illuminator?Service=Admin&Mode=UserList&Group=XMII Administrators

  • Oracle 11g R1 Automatic Installation shell scripts

    Hy Guys, Please can someone help me with: Oracle 11g R1 Automatic Installation shell scripts. A guide, how to or a link will be wellcome Kind Regards Easyman Edited by: Easyman on Feb 2, 2010 3:58 AM

  • Bit Map Index

    how to use BitMap index and function based index. in Oracle how its executed. how its taking data fast ??