I have the following script stored in a folder.
- Code: Select all
tell application "SecuritySpy"
capture image camera number 0 as "/Users/Server/Documents/SecuritySpy/Doorbell/picture1.jpg" with overwrite
delay 1
capture image camera number 0 as "/Users/Server/Documents/SecuritySpy/Doorbell/picture2.jpg" with overwrite
delay 2
capture image camera number 0 as "/Users/Server/Documents/SecuritySpy/Doorbell/picture3.jpg" with overwrite
delay 2
capture image camera number 0 as "/Users/Server/Documents/SecuritySpy/Doorbell/picture4.jpg" with overwrite
end tell
tell application "Mail"
set theSubject to "Ringeklokke aktivert" -- the subject
set theContent to "Noen er ved døra" -- the content
set theAddress to "MYMAIL" -- the receiver
set theAttachmentFile1 to "Macintosh HD:Users:Server:Documents:Securityspy:Doorbell:picture1.jpg"
set theAttachmentFile2 to "Macintosh HD:Users:Server:Documents:Securityspy:Doorbell:picture2.jpg"
set theAttachmentFile3 to "Macintosh HD:Users:Server:Documents:Securityspy:Doorbell:picture3.jpg"
set theAttachmentFile4 to "Macintosh HD:Users:Server:Documents:Securityspy:Doorbell:picture4.jpg"
set msg to make new outgoing message with properties {subject:theSubject, content:theContent, visible:true}
tell msg to make new to recipient at end of every to recipient with properties {address:theAddress}
tell msg to make new attachment with properties {file name:theAttachmentFile1 as alias}
tell msg to make new attachment with properties {file name:theAttachmentFile2 as alias}
tell msg to make new attachment with properties {file name:theAttachmentFile3 as alias}
tell msg to make new attachment with properties {file name:theAttachmentFile4 as alias}
send msg
end tell