AppleScript or Automator script to Change Mail Subject

The following AppleScrip works great with Microsoft Outlook and I tried to change the name to Mail and it did not work
tell application "Microsoft Outlook"
          try
                    set theMessage to item 1 of (get current messages)
                    if class of theMessage ≠ incoming message then error -99
          on error
                    display dialog "please select an incoming message before running
this script" buttons {"Abort"} default button 1 giving up after 10
          end try
          set oldSubject to subject of theMessage
          try
                    set newSubject to text returned of (display dialog "Enter New
Subject:" default answer oldSubject)
          on error
  -- user cancelled
                    return
          end try
          set subject of theMessage to newSubject
end tell
What I am trying to do is create an Automator script that can be added to my usr/Library/Serices folder that will let me change the Subject of an OS X 10.7 Apple Mail message. 
I am s novice on AppleScripts so some help will be appreciated

The error I get when I edit Microsoft Outlook to Mail says
Expected “,” but found plural class name.

Similar Messages

  • Is there an AppleScript or Automator Script that will wake a Mac from Sleep?

    Is there an AppleScript or Automator Script that will wake a Mac from Sleep?

    Frank and All,
    The following answer to your question above is complicated, but I hope it explains why my question was formed with so much frustration in it.
    I have an OpenOffice(OO) Macro that was launched with Calendar at 6pm each business night. It ran properly in all Apples operating systems until I Hit Maverick(OSX10.9). From then on, the AppleScript would run from one to 3 days, then would disappear from the Calendar entry. The Calendar alert would still run, but the "OpenFile" section of the alert would disappear. I also was running elgato EyeTV HD during the day, so I would use energy saver to put my MacBook Pro to sleep at 12 Midnight and wake it again at 9am. I picked up a used Mac Mini to do the EyeTV stuff, provide AppleTV the files in H264 format through iTunes' media share, and found it had plenty of power to do the 6pm automated stuff simultaneously as well. Because I still wanted to run the OpenOffice Macro on my MacBook Pro at 6pm, and wanted to use it for a host of other things when I was on the road, I wanted it to sleep most of the time and only wake up automatically to run the 6pm OO Macro. When I called Apple about the issue I was having with Maverick and Calendar loosing the OpenFile command as part of the Alert Message, they told me the no longer supported answering AppleScript Questions but they now would support Automator questions. I pointed out that the OpenFile would also fail after one to three days if I used a Calendar Alert to launch an Automator App. At first, I did not like Automator, but now I see why Apple is pushing us to use it. Automator adds a TIME STAMP ID to the Apps developed in Automator so the first time you launch the App after a change to it, you must reply to a dialog message saying that this is the first time you are running this version of the App. If a Scammer has replaced your app with one that can reek havoc on your computer, the replacement app will not run unless you are there to agree that you know where the modified app came from and click the OK button to continue (BRILLIANT, Enhanced Security idea on Apples part). I also noticed that after Mountain Lion, the Applescript delay timing was all screwed up as well. Well I tried to use LaunchD Task Scheduler to circumvent the Calendar Problem and that worked until I upgraded to Yosemite Last week. Then LaunchD no longer worked and I am only into a few days of using The Calendar Launched Automator App to see if it will continue to run.
    But I think I solved the dilemma I was having with opening an Automator App in a Sleeping Mac. I Googled up the following question, "AppleScript to wake up computer".  I went thru several complex responses until I found this on that is INCREDIBLE EASEY! What came back was a brettterpstra.com  response from Feb 20th,2014. What it said, in a Quick Tip: caffeinated your Terminal Article,  if you wanted to wake a Mac from sleep, use the Terminal command named "Caffeine -u -t 1". I placed it in an Automator Most Used Action called "Run Shell Script -- Caffeine -u -t 1" and it worked!  Now, I can put my Mac to Sleep but at 6pm, the Automator App will launch, run the "Caffeine -u- -t 1" command and proceed to work as if I had awakened the Mac From Sleep mode by pressing a keyboard key and had run the Automator Script with a double click.
    Sorry for the long, drawn-out reply, but maybe this will help others.

  • Change mail subject and body text

    Hi all,
    i activated access method M in tr. SPAD and via this method i'm sending various reports in PDF to external e-mails. But when recepitiens recive e-mail i have subject of e-mail composed of SYSTEM ID and SPOOL NUMBER (e.g. R3P-12345) and i also have defaulted mail body text :
    The Mail Attachment Contains the Print File Created by User XXXXX , with Number xxxx from SAP System R3P .
    To Print the Data, Open the Mail Attachment with a Suitable Program and Print the Document.
    How can i change mail subject and body text?
    Regards,
    PS*

    For the output type Maintian the Mail body and subject.
    You can do this at NACE==>Output Type ==> Mail title and texts
    rgds,
    TM
    See the link
    http://www.geocities.com/rmtiwari/main.html?http://www.geocities.com/rmtiwari/Resources/MySolutions/Dev/UtilityCode.html
    Message was edited by: Thomas Mann

  • IWeb Applescript and Automator - scripts you shouldn't be without

    Applescript and automator will automate mundane manual repetative task that seem to take forever. These scripts fill in iWeb's void that makes it hard to implement advance features such one click ftp publishing, code editing, swithching domain site files, etc. Don't miss out on these scripts that will save you ton of time. These are scripts you shouldn't be without.
    Work smarter not harder with iWeb applescript, only from MacEzzy.
    -- Also check out the free downloadable iWeb templates.
    Powerbook G4 Ti   Mac OS X (10.4.4)  

    Thank you for your feedback.
    -- Article never mentions compressed or uncompressed. Traditionally tiff format is used for buttons and small images on web pages and jpeg is used for higher quality photos exemplified by iWeb.
    -- Search engine spiders or crawlers start from top of the page to the bottom of html pages. They craw for topic as well as content. This is exactly what appears from iWeb html pages for meta (meta name="Generator" content="iWeb 1.0.1")
    -- I am the first to admit I don't know everything but I don't make up information. I use iWeb on a daily bases and try new things to push the envelope. Things that I find helpful to me I make it available for other iWeb community users so that they don't go through tribulation.
    -- I put google ads and paypal donate buttons throughout the pages to test if iWeb is up for commercial challenge. I also tested how well the search and replace script worked. I have exemplified in macezzy website it is possible to use iWeb for business purpose. The script worked extremely well, it would have taken hours to insert google and paypal codes manually. Using the script it only took 10 min. I wanted to share that with other users who might wanted to do similar things. Sorry if that offend you, I will remove them.
    -- I never claimed to have created the script except the script that makes the first folder in documents folder. I did change the wording so that it is clear to users that they are switching sites(domain file). I did not create the awesome search and replace script either. I do mention that I have made the iWeb_ftpUpload automator.
    I have started macezzy site when iWeb was introduced and there wasn't much information about iWeb. I have and do try many things with iWeb and report to iWeb community users of things that I find helpful. I haven't made a dollar off the site and I have invested lot of my time because I like to see other users succeed.
    Powerbook G4 Ti   Mac OS X (10.4.4)  

  • Change mail subject and body

    Hi all,
    I configured a 'printer' in SPAD that is used to send email with pdf attachments with the smartforms / sapscritps that I developed.
    Is there a way to change email subject and body instead of standard text "The Mail Attachment Contains the Print File Created by User" bla bla bla?
    This is critical to me.
    Thanks in advance!
    Regards,
    André

    If you are already able to send the pdf attachment through mail using Function Modles 'CONVERT_OTF_2_PDF' &
    SO_NEW_DOCUMENT_ATT_SEND_API1 and the problem is with subject and Attachment name only then
    in the SO_NEW_DOCUMENT_ATT_SEND_API1 function Module
    For Subject
      EXPORTING
      document_data = docdata
    For Attachment Name
      TABLES
      packing_list = objpack
    Declarations for the above two are
    DATA:
      objpack LIKE sopcklsti1 OCCURS 1  WITH HEADER LINE,
      docdata LIKE sodocchgi1.
    and the values you need to pass are
      objpack-obj_descr = 'Invoice'. "Attachment name
      docdata-obj_descr = 'Mexico Direct Invoice'. "Subject of the mail
    Thanks,
    Phani.

  • Use AppleScript or Automator (or both) to get Mail and add to a text file?

    Hello all,
    I'm sorry if this is a duplicate of a well-known topic, I tried searching and couldn't see anything.
    I'm behind a proxy at work that blocks any kind of webmail access, but I'd like to be able to check my email while on a break or something.
    I had the idea that I could use Automator or Applescript to check my mail, get the new messages and add the text to a textfile that I could host on my personal webserver that I use for family stuff.
    I've tried an automator workflow that seems to work while in Automator, but when I save it as an application, it won't even start Mail to check.
    I also thought of just leaving mail running, and have a rule that starts a script when new mail arrives, but I don't know enough about Applescript to do it.
    I don't want to confuse anyone with the details of my convoluted ideas, so I'll leave it at that.
    Is there a way to do this? I want mail to check the server, download the messages, new messages get their text appended to a text file that's stored in my webserver's directory (same computer) that I can access from the web, and have it repeat every 5 minutes or so.
    If I've left out a detail, let me know, and if I'm just stupid and there's an easy way to do this... be kind.
    Thanks!
    aeix
    iMac G5 2.0 GHz   Mac OS X (10.4.6)  

    It certainly is going in the right direction. I'm not all that versed in AppleScript, but it looks like that particular script is creating a new text file for every message processed.
    I would like to either create a specific text file if it doesn't exist, or append the text to the end of the file if it does exist.
    But like I said, definitely heading in the right direction!
    iMac G5 2.0 GHz Mac OS X (10.4.6)

  • Is there a script or automator action to change Preferences in Safari?

    When I log on to my ISPs website to clean out my spam filter, the site redirects me to a second area that contains the filtered spam. Each time I access it I must change my "Accept Cookies from "Only sites you navigate to" to "Always". The problem is remembering to change it BACK. Is there an applescript or automator thingy that will allow me to to make these changes? I'm using Safari 3.1.2.
    Thank you.

    Andrew, this script also really helped me, and it has the potential to help thousands of others. Safari 3 cookie management is a work in progress. SafariPlus did a wonderful job of improving this previously, but so far no Leopard version. Even limited cookie acceptance accepts waaay too many. So I decided to delete all my cookies, and turn on just limited acceptance the first time I visit certain websites that really need cookies, to get the primary account cookies in place, and then set cookie acceptance level back to never for general browsing.
    Then I looked for an Applescript to simplify this, and found the one you wrote. I then modified it for my purposes and it works great. I run it with XKeys and it makes life easy, and more secure. I think many others could benefit from this, so I think one of us should publish it perhaps at Versiontracker, etc. Your basic script, so I vote for you. If not, can I? Here's my mod:
    tell application "Safari" to activate
    tell me to activate
    display dialog "Would you like to accept LIMITED cookies?" buttons {"Cancel", "OK"} default button "OK"
    if button returned of result is "OK" then
    tell application "Safari" to activate
    tell application "System Events"
    tell process "Safari"
    click menu item "Preferences…" of menu "Safari" of menu bar 1
    delay 1
    tell window 1 to click button "Security" of tool bar 1
    delay 1
    tell window "Security"
    tell group 1
    tell group 1
    tell radio group 1
    click radio button "Only from sites you navigate to"
    delay 0.5
    keystroke "w" using command down
    end tell
    end tell
    end tell
    end tell
    end tell
    end tell
    end if
    delay 60
    tell me to activate
    display dialog "Click 'Cancel' to continue accepting LIMITED cookies... Click 'Not Yet' for continued reminders... Click 'Revert' to STOP accepting cookies." buttons {"Cancel", "Not Yet", "Revert"} default button "Revert"
    if button returned of result is "Revert" then
    tell application "Safari" to activate
    tell application "System Events"
    tell process "Safari"
    click menu item "Preferences…" of menu "Safari" of menu bar 1
    delay 1
    tell window 1 to click button "Security" of tool bar 1
    delay 1
    tell window "Security"
    tell group 1
    tell group 1
    tell radio group 1
    click radio button "Never"
    delay 0.5
    keystroke "w" using command down
    end tell
    end tell
    end tell
    end tell
    end tell
    end tell
    else
    if button returned of result is "Not Yet" then
    repeat while button returned of result is "Not Yet"
    tell application "Safari" to activate
    delay 30 -- increase if desired to lengthen interval between reminders
    tell me to activate
    display dialog "Click 'Cancel' to continue accepting LIMITED cookies... Click 'Not Yet' for continued reminders... Click 'Revert' to STOP accepting cookies." buttons {"Cancel", "Not Yet", "Revert"} default button "Revert"
    end repeat
    if button returned of result is "Revert" then
    tell application "Safari" to activate
    tell application "System Events"
    tell process "Safari"
    click menu item "Preferences…" of menu "Safari" of menu bar 1
    delay 1
    tell window 1 to click button "Security" of tool bar 1
    delay 1
    tell window "Security"
    tell group 1
    tell group 1
    tell radio group 1
    click radio button "Only from sites you navigate to"
    delay 0.5
    keystroke "w" using command down
    end tell
    end tell
    end tell
    end tell
    end tell
    end tell
    end if
    end if
    end if

  • Purchase order by e-mail: changing the e-mail subject

    Hello all,
    We are sending are purchase orders to the vendors by e-mail.
    I would like to know how can I change the e-mail subject to a subject of my choice (for instance the PO number, etc.).
    Thanks for your help,
    Sivan

    Hi,
    You can  change the e-mail subject to a subject of your choice by following way.
    If you want to send a purchase order as (external) mail, for example, to a
    vendor, you have to maintain the mail title in the condition record for the
    output type (for example in Transaction MN05) on the 'Communication method' tab
    page. Enter the mail title in the 'Text for cover page' field. You cannot
    maintain an additional mail text.
    Hope this will help u,
    Deepak

  • Change the subject on a received e mail

    is it possible to change the subject of a received e mail in order to file it ?

    AFAIK, not with Apple's Mail app. That's doable with Eudora.

  • EREC: Change the subject of rejection e-mail

    Hi everyone,
    I'd like to change the rejection e-mail's Subject, but I can't find the customizing, or the relevant part of the code, where the subject is created.
    I checked the workflow log (transaction swell) and I think I found the part when the email is created there are two task:
    There is to Activity "Create activity" and "Send document"
    The first one is using the
    ERC_ACTIV - CREATEACTFROMDATA method to create the activity
    ERC_ACTIV - PROCESSDOCUMENT  is to send the document
    It is using the cl_hrrcf_act_abstract_corr_rec:
    * Document will be sent by the channel EMAIL.  
           CALL METHOD LO_ACT_CORR->PROCESS_DOCUMENT
             EXPORTING                              
               CHANNEL  = 'E_MAIL'                  
             IMPORTING                              
    *    DOCUMENT =                                
                RETURN   = LT_RETURN                
    The problem is that I debugged several times, but can't find the place, where the subject of the e-mail is created.
    Do you have any idea, where can I change the subject of the rejection e-mail?
    Thanks & Bye
    N.

    Hello,
    The standard system uses the description of the smartform as the subject of the e-mail so you could copy the smartform and change the description to suit your requirement. If you wish to put your own logic for getting the subject at runtime I think it is done in class CL_HRRCF_CS_DOC_CAT_SF_SUPER. In there is method set_subject I think. You will then maybe copy this and make your own class with the required methods and use them while sending a smartform. Hope this helps.
    Regards

  • Change outgoing mail subject

    Hi Guru's,
    I need to change the subject of the outgoing standad mail template dynamically by the comlaint id which i get it through the refernce field of the mail.
    or is there any way through which the refernce id can be copied in the mail subject.
    Thanks,
    regards,
    akshay ruia.

    settings - mail - account - outgoing mail server

  • Change Email Subject of Outgoing mails

    Hello Folks,
    I have a requirement wherein I need to add a text "[Test Mail]" in the email subject of all outgoing mails from our dev/test systems. This is to ensure that the end users who are the receipients are able to distinguish the emails sent out by the test system from the emails sent out by the actual production system.
    Do let me know if anyone out here has developed something similar or can provide some advice/help into this matter.
    Thanks in advance,
    Abhishek

    Hi Brad,
    We are mainly using CL_BCS as well as FM SO_NEW_DOCUMENT_ATT_SEND_API1 in the system. The problem here is that there is no one fixed/common approach being followed. So I need to understand if there is a way by which I can access all the outgoing mails from the system and change the subject.
    One option that I thought was to find out some enhancements or BADIs within CL_BCS and FM SO_NEW_DOCUMENT_ATT_SEND_API1 to manipulate the subject line before the mail is sent out. This would  cover most of the cases where mails are sent out from the system, but I am not sure if the mails can be sent out by any other means as well.
    abhishek

  • Script to extract info from Mail subject line?

    I'd like to set up a rule that copies all subject lines containing text I specify to a text file. For example... all subject lines containing "has subscribed" would be copied to subscribers.txt. Is this possible?

    <pre style="
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    font-weight: normal;
    margin: 0px;
    padding: 5px;
    border: 1px solid #000000;
    width: 720px;
    color: #000000;
    background-color: #E6E6EE;
    overflow: auto;"
    title="this text can be pasted into the AppleScript Editor">
    using terms from application "Mail"
    on perform mail action with messages theMessages
    tell application "Finder" to set ptd to (path to desktop folder) as string
    tell application "Mail"
    repeat with theMessage in theMessages
    if subject of theMessage contains "has subscribed" then
    set theText to (subject of theMessage & return)
    set theFile to ptd & "subscribers.txt"
    set theFileID to open for access file theFile with write permission
    write theText to theFileID starting at eof
    close access theFileID
    end if
    end repeat
    end tell
    end perform mail action with messages
    end using terms from
    </pre>

  • Is there an Applescript or Automator action that can change Preferences in

    When I log on to my ISPs website to clean out my spam filter, the site redirects me to a second area that contains the filtered spam. Each time I access it I must change my "Accept Cookies from "Only sites you navigate to" to "Always". The problem is remembering to change it BACK. Is there an applescript or automator thingy that will allow me to to make these changes? I'm using Safari 3.1.2.
    Thank you.

    This question was answered in the Safari-for-Mac forum.

  • Action Playback option changes the Result of an Automated Script.

    When using the Playback Option in the Actions menu, then the  Results are different with different Acceleration methods.
    So the Result is different with, Accelerated - Step by Step - Pauze for [1],
    I Expierence the issue with Windows and Mac as well.
    This happens with Illustrator CS5 (15.0.1)
    # Workflow
         Creating the action:
         Open Illustrator, open the attached document: 4102107 Exact.pdf
         Create an New Action, enable Transform window
         Select the Black Square and the Red text Exact
         Go to Object, Scale > 33.3% and press Copy.
         Then go to Transform an from the upper corner and enter on the
         x=397,13 pt y=212,25 pt
         You see the Image moved to the correct clip.
         Open the Document in Illustrator,
         Go to Actions > Select the created action >Now go to the Panel Menu from Actions > Select Playback option.
         You get a new Dialog where you can select a different acceleration mode: "Step by Step" - "Accelrated" - "Pause for [Numeric] Seconds"
         So the issue is, when you select here a different accelration the result is different.
    >Is this as Designed? If So, why because when i understand the function of an automated script. It should exactly get the same
    result as programmed, why else would you want to use the script if the result with be different without nothing.
    There is running an Escalation case about this, But hopefully anybody more experienced can comment me about this. Or inform wheter  it's a bug?
    Please help me in this. (thank you in advance!)

    To make a few things clear I have created a Video of the issue.
    Have a look on:
    http://adobesupport.emea.acrobat.com/p65456795/
    Maybe i really blow in explaining what exactly happens, but i'll try it again.
    When creating an action (as shown in the Video) You can see that the result
    is totally different and when creating the action. This is error 1.
    - I recieved a respons that we just shouldn't use the Transform Panel. So i requested to know why there is a panel created, if we cannot use it.
    No respons.
    Then when you select a Playback option in the setting of the Actions Panel,
    the Result differs. As you can see when executig in the Accelerated the Movement gets placed WAY out of the file.
    When selection Step by Step or Pause for [Numeric] Seconds, then the result is that the movement gets placed
    at the bottom of the file. Both of the Results don't even come close in the Action which is created.
    Hopefully this will calrify what i ment.

Maybe you are looking for

  • Open link in browser

    Hi Experts, I want to open a link in browser through SAP code. The report has to be scheduled in background. Is there any function module to do the same? Thanks in advance. Supriya.

  • F.13 Automatic clearing + Document Type (external number)

    Test Edited by: Programador Abap on May 28, 2010 11:23 AM

  • About ABAP Client proxy

    Hi Experts, Through ABAP client proxy I am sending data to PI system, when i execute the calling program then it executes fine, but data is not going to PI system. I couldn't find any message sent from R/3 in the SXMB_MONI (R/3 system). R/3 to PI con

  • Cannot transcode in Oncore CS6

    When I "send to Oncore" in Premiere CS6 the project transferrs but will nor Transcode. I've tried DVD Disk, BD disk, and both disk images. Nothing works. I have just edited an extensive project and need to get it published. I never had this happen wi

  • Tons of things I need to fix After Updated 10.5.8

    Help Help Help Help!!!! Since I upgraded my Macbook 13' 2.16 GHZ intel Core 2 duo, I had a lot of problems that I don"t know how to fix : 1 ) I'm able to empty my trash but not see what's in it. Try tons of time to open it, but i doesnt respond. 2) I