Applescript and mail attachments
I am very new to applescript, and i am trying to create an email, and add an attachment to it.
Unfortunately, the file specified is not attached even though it exists. Could someone tell me kindly what i am doing wrong?
This is my (very basic) script :
set msg to "no"
tell application "Finder"
if exists file "Macintosh HD:Users:jonweston:Documents:Tree Safety:Accountant:Payment Record Running 31.pdf" then
set msg to "yes"
end if
end tell
display dialog msg
set theAttachment to "Macintosh HD:Users:jonweston:Documents:Tree Safety:Accountant:Payment Record Running 31.pdf"
tell application "Mail"
set theMessage to make new outgoing message with properties {visible:true, subject:"My Subject", content:"My Body"}
tell content of theMessage
make new attachment with properties {file name:theAttachment} at after last paragraph
end tell
end tell
Thanks a lot
FP
Mac Pro, Mac OS X (10.6.5)