the screenshot.jpg to the email.
The file on the desktop just shows as "screenshot", without the .jpg extension.
Maybe that's the problem?
Any help greatly appreciated!
- Code: Select all
set screenShotFile to (path to desktop as text) & "screenshot.jpg"
do shell script "screencapture -m " & quoted form of POSIX path of screenShotFile
delay 3
tell application "Mail"
set addressList to {"xxxx@xxxxx.net"}
set nameList to {"Carl"}
set bodyvar to "Here is the saved webcam image."
set subjectvar to "Webcam Image"
set attachmentVar to screenShotFile
set newMessage to (a reference to (make new outgoing message))
tell newMessage
repeat with i from 1 to count nameList
make new to recipient at end of to recipients with properties {name:item i of nameList, address:item i of addressList}
end repeat
set the subject to subjectvar
set the content to bodyvar
tell content
make new attachment with properties {file name:attachmentVar}
end tell
end tell
send newMessage
end tell
Thanks,
Carl