Hi everyone, I am new to here...
Can anyone help explaining this:
I use the following code in my applescript for Mail.app, it's supposed to be run under certain rule:
using terms from application "Mail"
on perform mail action with messages theMessages
tell application "Mail"
display dialog "On perform mail action"
my saveAttachments(theMessages)
end tell
end perform mail action with messages
end using terms from
and I have another "on run" block which is for debugging purpose:
on run
tell application "Mail"
display dialog "On run"
set theSelection to selection
my saveAttachments(theSelection)
end tell
end run
the "saveAtachments" works fine with "on run" (run from script editor) but does not work with "on perform mail action"...
After debugging for some whole days, I found that the following code displays the raw source for the message when running with "on run", but displays something other than the raw source for "on perform mail action".
repeat with eachMessage in messageList
-- messageList is the parameter passed into "saveAttachment"
display dialog source of eachMessage as text
end repeat
Can someone explain why, thanks a million in advance!
Btw, I am new to applescript...my code is from here:
http://lists.apple.com/archives/applescript-users/2003/Dec/msg01153.html
Btw2, the raw source I want starts with "Return-path: ...". This is what is displayed in Mail.app's view of raw source.
Btw3, the Mail.app on my PC is 1.3.11 (v622/624)
Thank you all the same for your time if you are just viewing~
Can anyone help explaining this:
I use the following code in my applescript for Mail.app, it's supposed to be run under certain rule:
using terms from application "Mail"
on perform mail action with messages theMessages
tell application "Mail"
display dialog "On perform mail action"
my saveAttachments(theMessages)
end tell
end perform mail action with messages
end using terms from
and I have another "on run" block which is for debugging purpose:
on run
tell application "Mail"
display dialog "On run"
set theSelection to selection
my saveAttachments(theSelection)
end tell
end run
the "saveAtachments" works fine with "on run" (run from script editor) but does not work with "on perform mail action"...
After debugging for some whole days, I found that the following code displays the raw source for the message when running with "on run", but displays something other than the raw source for "on perform mail action".
repeat with eachMessage in messageList
-- messageList is the parameter passed into "saveAttachment"
display dialog source of eachMessage as text
end repeat
Can someone explain why, thanks a million in advance!
Btw, I am new to applescript...my code is from here:
http://lists.apple.com/archives/applescript-users/2003/Dec/msg01153.html
Btw2, the raw source I want starts with "Return-path: ...". This is what is displayed in Mail.app's view of raw source.
Btw3, the Mail.app on my PC is 1.3.11 (v622/624)
Thank you all the same for your time if you are just viewing~