On May 02, 2014, at 03:49, Anthony Femenia < email@hidden> wrote:
I want to open a mail window from Safari with the "email
contents" command, but with pre-filled fields (cci, to,
attachment and signature).
______________________________________________________________________
Unfortunately you can't.
Once a message has been created in Mail you can no longer manipulate it via AppleScript unless you resort to UI-Scripting with System Events. This is Bizarro Apple in action and defies all reason, but there you go. We've hounded them for years about this, the inability to set the selection, and a few other things - to little avail.
It's really strange in view of the fact that Mail is fairly scriptable.
You can do something like this with vanilla AppleScript:
-------------------------------------------------------------------------------------------
set toName to "John Smith" set _subject to "Test Message" set _body to "Now is the time for all good men to come to the aid of their country." set _sig to "Take_Care"
tell application "Mail" set _sig to signature _sig set _msg to make new outgoing message with properties {subject:_subject, content:_body & return & return} tell _msg set visible to true make new to recipient at end of to recipients with properties {name:toName, address:toAddress} set sender to _sender set message signature to _sig end tell activate end tell
-------------------------------------------------------------------------------------------
If you want to fool with UI-Scripting try Googling this:
-- Best Regards, Chris
|