• 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: Variable for multiple recipients in Mail
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Variable for multiple recipients in Mail


  • Subject: Re: Variable for multiple recipients in Mail
  • From: Malcolm Fitzgerald <email@hidden>
  • Date: Mon, 20 Feb 2006 17:13:47 +1100


On 20/02/2006, at 9:25 AM, Dan Doughtie wrote:

I have a script that automatically attaches an FTP link to an email and uses
the name of the file to determine who should get the email.


My challenge is I want to have one creation step with the variables changing
depending on the receiving location. I could use variables to set the name
and address but each location gets different number of recipients so that
doesn't work.


I have created a variable that consists of a string that mimics the hard
coded. Here is the hard code.



Tell new message
Set content of it to the_body
Make new to recipient at end with properties {name: "Jane Doe", address:
"email@hidden"}
Make new to recipent at end with properties {name: "John Roe", address:
"email@hidden"}


End tell


so I did

Set myRecips to "Make new to recipient at end with properties {name: \"Jane
Doe\", address: \"email@hidden\"}
Make new to recipent at end with properties {name: \"John Roe\", address:
\"email@hidden\"}"


Then tried
Tell new message
Set content of it to the_body

myRecips

End tell
-----
The variable matches the command but I guess I need some kind of statement
or such that says treat this string as a line of code and I can't find a
way to do it

You won't find a way to do that. Try something like this:


set newMsg to make new outgoing message
set the_body to "hello world"
set myRecips to {{name:"Jane Doe", address:"email@hidden"}, {name:"John Roe", address:"email@hidden"}}



tell newMsg set content of it to the_body repeat with i from 1 to length of myRecips make new to recipient at end with properties item i of myRecips end repeat end tell set visible of newMsg to true -- check to see if it is working


Malcolm

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Variable for multiple recipients in Mail (From: Dan Doughtie <email@hidden>)

  • Prev by Date: Variable for multiple recipients in Mail
  • Next by Date: Re: Toggle Screensaver - OP Feedback & POSIX file issues
  • Previous by thread: Variable for multiple recipients in Mail
  • Next by thread: Lists, Arrays, or Records ????
  • Index(es):
    • Date
    • Thread