I copied the script below for sending text. messages via AppleScript in an Action. (I'm not using the iMessage plugin because of problems getting it to work). Here's my code:
=======
- Code: Select all
use application "IndigoServer"
set pvSubject to value of variable "vTxtMsgSubject"
set pvMessage to value of variable "vTxtMsgBody"
set pvBuddy to value of variable "vTxtMsgBuddy"
set targetMessage to "{Indigo} " & pvSubject & " " & pvMessage
tell application "Messages"
set targetService to 1st service whose service type = iMessage
set targetBuddy to buddy pvBuddy of targetService
send targetMessage to targetBuddy
end tell
This works great EXCEPT if the message app on the system running Indigo does NOT ALREADY HAVE a message from the buddy the script is trying to send to. This is an issue if you are adding a new phone number to send the message to, or if the string of messages from the recipient on the Indigo system have all been deleted.
Basically, there is no existing Buddy to reference. There would need to be a way to specify a NEW Buddy, somehow.
Is there a way to send a message using AppleScript that would work in these cases? I.e. the AppleScript is trying to send to a phone number that is not in the list of existing messages.
Any thoughts? I'd be willing to take on a Python script if it would work in both cases.
thanks in advance!
-russg