• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Fwd: I need help to customize email with AppleScript
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fwd: I need help to customize email with AppleScript


  • Subject: Fwd: I need help to customize email with AppleScript
  • From: Anthony Femenia <email@hidden>
  • Date: Fri, 02 May 2014 10:49:38 +0200

Hi all,

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



 _______________________________________________
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

  • Follow-Ups:
    • Re: I need help to customize email with AppleScript
      • From: Shane Stanley <email@hidden>
    • Re: I need help to customize email with AppleScript
      • From: Christopher Stone <email@hidden>
  • Next by Date: Re: XMLlib library - somewhat.
  • Next by thread: Re: I need help to customize email with AppleScript
  • Index(es):
    • Date
    • Thread