Script SMS
  • 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
  • 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

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!