Hoping all is well with you and your family.
Been having some issues with the mail.app sending without asking for that ol pesky password etc.
I was wondering if your time permitted if you could help with a few small lines of code to get me in the right direction.
Here is what I have that works when mail.app is behaving properly:
- Code: Select all
tell application "SecuritySpy"
capture image camera number 2 as "/Users/bob/Desktop/SecuritySpyimage.jpg"
end tell
set theSubject to "Mailbox Sensor Detection"
set theSender to "cornmeal@gmail.com"
set theAddress to "bobby@aol.com"
set theAttachment to "/Users/bob/Desktop/SecuritySpyimage.jpg"
tell application "Mail"
set theMessage to make new outgoing message with properties {subject:theSubject, sender:theSender}
tell theMessage
set visible to false
make new to recipient at end of to recipients with properties {address:theAddress}
make new attachment with properties {file name:theAttachment} at after the last paragraph
end tell
send theMessage
end tell
tell application "Finder"
activate
if file "Macintosh HD:Users:bob:Desktop:SecuritySpyimage.jpg" exists then
delete file "Macintosh HD:Users:bob:Desktop:SecuritySpyimage.jpg"
end if
delay 1
end tell
tell application "System Events"
set visible of process "Mail" to false
end tel
Mail.app makes me nervous cause I never know when it will fail to send due to asking for password.
Here is what I need to work:
- Code: Select all
tell application "SecuritySpy"
capture image camera number 2 as "/Users/bob/Desktop/SecuritySpyimage.jpg"
end tell
do shell script "echo |mail -s 'Email Subject' bobby@aol.com -a /Users/bob/Desktop/SecuritySpyimage.jpg"
tell application "Finder"
activate
if file "Macintosh HD:Users:bob:Desktop:SecuritySpyimage.jpg" exists then
delete file "Macintosh HD:Users:bob:Desktop:SecuritySpyimage.jpg"
end if
delay 1
end tell
I just need help with the shell script part. So close and yet so far
T.I.A.