I want to open a mail window from Safari with the "email
contents" command, but with pre-filled fields (cci, to,
attachment and signature).
Problems come when I want to fill these fields with
AppleScript.
Here is my test (of course, dest, cci, and att are initialized and the "PR" signature
exists) :
tell application "Safari"
open file tempFile
activate
tell front
window
email
contents of current
tab
delay 0.5
close current tab
end
tell
end
tell
tell application "Mail"
set
theNewMessg to the
front window
set
message signature of
theNewMessg to signature "PR"
tell theNewMessg
make new to recipient at end
of to recipients with properties {address:dest}
make new bcc recipient at end
of bcc recipients with properties {address:cci}
make new attachment with properties {file name:att as
alias} at after the last
word of the
last paragraph
end
tell
end tell
I think my main problem is to get the new opened mail window,
from the "email contents" command...
Hope you can help me…
Thanks !
PS :
I use Mac OS X Lion (10.7.2), Mail.app 5.0, and Safari 5.1
--
Anthony