Outlook 2011 Script Problem
Outlook 2011 Script Problem
- Subject: Outlook 2011 Script Problem
- From: Dave <email@hidden>
- Date: Mon, 27 Apr 2015 11:24:34 +0100
Hi,
Please see script below.
I’m using this script to set the First Line of an outgoing message in Outlook, this is run from a regular Cocoa Application using NSAppleScript.
When the Script is run, the user has the email window in front and they hit an FKey that causes my App to run the Script. This all works ok, but the modified version of the data doesn’t seem to get saved.
If I run this script in the Script Editor, I see that the saved message in the “Drafts” Container update the Contents, but the window doesn’t change.
I added the “close front window” statement, but it doesn’t seem to make a difference.
Is there anyway to make this work? I’m a bit confused how to handle a Window as apposed to a Message in Outlook. I just want to operate on the message represented by the Front Window, is my code ok for that?
Thanks in advance for any help.
All the Best
Dave
——————————————————————
on run
tell application id "com.microsoft.Outlook"
activate
save front window
set myMessageList to current messages
set myMessage to item 1 of myMessageList
set myContent to the plain text content of myMessage
set myContent to “[Data1]" & return & myContent
set the plain text content of myMessage to myContent
save front window
send myMessage
close front window —Added
end tell
end run
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden