Saturday, August 8, 2020

#1 2020-07-28 10:33:36 am

bocciaman
Member
Registered: 2019-07-22
Posts: 9

Sending on Messages App via AppleScript

Trying to determine what's wrong with the script below, I don't know if I placed the phone number in the right place. Can someone help and show me where to place the number and in what format within the script?

Applescript:

on run {targetPhoneNumber, targetMessageToSend}
   tell application "Messages"
       set targetService to 1st service whose service type = iMessage
       set targetBuddy to buddy "+1 555 555 5555" of targetService
       set targetMessage to "Where are you?"
       send targetMessage to targetBuddy
       say targetMessage
   end tell
end run

Model: 2009 iMac
AppleScript: 2.7
Browser: Safari 537.36
Operating System: macOS 10.14

Last edited by bocciaman (2020-08-01 02:00:56 pm)


Filed under: , applescript, messages, phone

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)