• 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
Re: can't make {to recipient} from {get recipient of theMessage}
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: can't make {to recipient} from {get recipient of theMessage}


  • Subject: Re: can't make {to recipient} from {get recipient of theMessage}
  • From: Axel Luttgens <email@hidden>
  • Date: Sun, 1 Nov 2009 11:53:14 +0100

Le 1 nov. 2009 à 06:18, James Udo Ludtke a écrit :

I am trying to get an AppleScript to work in Mail.app.

[...]

Here is the code:

tell application "Mail"

[...]

tell theNewMessage
make new to recipient at beginning of to recipients with properties {address:addrVar}
end tell


end tell

I suspect the format of {get recipients of theMessage} is different from what <make new to recipient> expects, but I can't figure out what to do about it.

Hello James,

Indeed, a message's recipient is an object.
On the other hand, a "make new ... with properties ..." expects a record whose items define some or all of the distinctive properties of the object -here, a recipient- to be built.


Something along those lines is thus needed:

tell application "Mail"
set RcptProps to {name:name, address:address} of item 1 of to recipients of item 1 of (get selection)
tell (make new outgoing message with properties {subject:"My Subject", content:"Blah, blah,blah", visible:true})
make new to recipient at beginning of to recipients with properties RcptProps
end tell
end tell


HTH,
Axel _______________________________________________
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
  • Prev by Date: Re: how to convert *space* to
  • Next by Date: Re: Encoding text file to write XML
  • Previous by thread: Re: how to convert *space* to
  • Next by thread: Fwd: can't make {to recipient} from {get recipient of theMessage}
  • Index(es):
    • Date
    • Thread