A
Auri Rahimzadeh
I want to duplicate a mail message in Applescript... so I want to be
able to read the current message draft window and create a new message
based on its contents using an Applescript... any ideas? Here's my
(poor) code... The error I'm getting is "Can't get subject of draft
window." and then it quits. The script *does* compile fine. Any help
would be greatly appreciated! Thanks!
Best,
-Auri
tell application "Microsoft Entourage"
display dialog "Done with part 1" with icon 1
-- get the message we're working on into a variable
set currentMessage to the draft window
-- if there is no message to duplicate, warn the user and then quit
if currentMessage is {} then
display dialog "Sorry, there is no message for me to duplicate. Waah!"
with icon 1
return
end if
-- grab the data from the message draft window
set theSubject to (subject of currentMessage)
set theCategory to (category of currentMessage)
set theContent to (content of currentMessage)
-- create a new message with the information from the current message
set newMessage to make new message with properties {subject:theName,
category:theCategory, content:theContent}
-- open the new message we just created
open newMessage
end tell
able to read the current message draft window and create a new message
based on its contents using an Applescript... any ideas? Here's my
(poor) code... The error I'm getting is "Can't get subject of draft
window." and then it quits. The script *does* compile fine. Any help
would be greatly appreciated! Thanks!
Best,
-Auri
tell application "Microsoft Entourage"
display dialog "Done with part 1" with icon 1
-- get the message we're working on into a variable
set currentMessage to the draft window
-- if there is no message to duplicate, warn the user and then quit
if currentMessage is {} then
display dialog "Sorry, there is no message for me to duplicate. Waah!"
with icon 1
return
end if
-- grab the data from the message draft window
set theSubject to (subject of currentMessage)
set theCategory to (category of currentMessage)
set theContent to (content of currentMessage)
-- create a new message with the information from the current message
set newMessage to make new message with properties {subject:theName,
category:theCategory, content:theContent}
-- open the new message we just created
open newMessage
end tell