Skip to content

Script SMS

edited June 2020 in SecuritySpy
Hello,
I run this script without problem. But if I add a second number I have an error. What is the solution please.
Thank you.

tell application "SecuritySpy"
capture image camera number 19 as "/tmp/ss-temp-image.jpg" with overwrite
end tell

tell application "Messages"
set targetService to id of 1st service whose service type = iMessage
set theBuddy to buddy "0007013861" of service id targetService
set theBuddy to buddy "0002912164" of service id targetService
send file POSIX file "/tmp/ss-temp-image.jpg" to theBuddy
end tell

Comments

  • Apparently there is no AppleScript command to send one message to multiple recipients. It looks like you will need to send to each recipient individually, like this:

    set targetService to id of 1st service whose service type = iMessage

    set theBuddy to buddy "0007013861" of service id targetService
    send file POSIX file "/tmp/ss-temp-image.jpg" to theBuddy

    set theBuddy to buddy "0002912164" of service id targetService
    send file POSIX file "/tmp/ss-temp-image.jpg" to theBuddy

  • you are great. it works perfectly. thank you
Sign In or Register to comment.