Rev & Applescript

Sarah Reichelt sarahr at genesearch.com.au
Tue May 3 18:13:08 EDT 2005


> I've gotten one script to work (has one file attachment) but the 
> second does
> not. I don't know if my repeat loop is not correct or the way I'm 
> delimiting
> the file attachments, or both. Each email will have 2 or more 
> attachments.
>
>
> DOESN'T WORK:
> tell application "Mail"
>     set theSubject to "BS Order"
>     set theBody to "TESTING 123"
>     set theSender to "martyknapp at comcast.net"
>     set theName to "ADI"
>     set theAddress to "martyknapp at comcast.net"
>     set fileList to <path to file 1> & return & <path to file 2>
>
>     set newMessage to make new outgoing message with properties
> {subject:theSubject, content:theBody & return & return}
>     tell newMessage
>         -- Default is false. Determines whether the compose window will
>         -- show on the screen or whether it will happen in the 
> background.
>         set visible to true
>         set sender to theSender
>         make new to recipient at end of to recipients with properties
> {name:theName, address:theAddress}
>         tell content
>             repeat with fileName in fileList
>                 make new attachment with properties {file 
> name:fileName} at
> after the last paragraph
>             end repeat
>         end tell
>     end tell
>
>     send newMessage
> end tell
>
The "repeat with" in AppleScript expects an AppleScript list which is 
in the format:
{"first item", "second item"}

Try this (or some minor variation):
  	set fileList to "{" & <path to file 1> & "," & <path to file 2> & "}"

Cheers,
Sarah



More information about the use-livecode mailing list