I have a Folder Action Script, from MurphyMac, set up to email files dropped into the folder and it works. I would like to enhance it by
- setting the Subject line to be the name of the dropped file and
- sending the email without bringing Mail to the front
Can someone please help me?
Many thanks in advance.
Best wishes
Simon
The script so far is as follows:
(*
Murphy Mac
see http://murphymac.com/files-mailed-magically-when-dropped-in-a-finder-folder/ for more information.
*)
on adding folder items to thefolder after receiving theAddedItems
repeat with eachitem in theAddedItems
set theSender to "Simon<simon@xxx.xx.uk>"
set recipCommon to "Documents"
set recipAddress to "xxxxx@xxxxxxx.com"
set msgText to ""
tell application "Mail"
set newmessage to make new outgoing message with properties {subject:"Important File Attachment", content:msgText & return & return}
tell newmessage
set visible to true
set sender to theSender
make new to recipient with properties {name:recipCommon, address:recipAddress}
make new attachment with properties {file name:eachitem} at after the last paragraph
end tell
send newmessage
end tell
end repeat
end adding folder items to