Hi Guys!
I hope somebody can assist me with an applescript I am attempting.
The aim: to send myself an image from my MAC to my iphone via Messages/iMessage.
OK, I can send text messages successfully with the following:
How do I now add an image to the message?
I was trying something like the following:
WIth the above, I get the following error back:
"Messages got an error: Can’t make or move that element into that container."
I am not sure what this means or what the solution is
It also seems like I should tell Messages to send the attachment. Not sure if it should be part of the "send" command, or if I should send the image in it's own "send" call.
Any help will be greatly appreciated!
Thanks!
I hope somebody can assist me with an applescript I am attempting.
The aim: to send myself an image from my MAC to my iphone via Messages/iMessage.
OK, I can send text messages successfully with the following:
Code:
tell application "Messages"
set myid to get id of first service
set theBuddy to buddy "+123456789" of service id myid
send "Test message" to theBuddy
end tell
How do I now add an image to the message?
I was trying something like the following:
Code:
tell application "Messages"
set myid to get id of first service
set theBuddy to buddy "+123456789" of service id myid
set targetFileName to "Macintosh HD:Users:user:Pictures:picture.PNG:"
make new attachment with properties {file:targetFileName}
send "Test message" to theBuddy
end tell
WIth the above, I get the following error back:
"Messages got an error: Can’t make or move that element into that container."
I am not sure what this means or what the solution is
It also seems like I should tell Messages to send the attachment. Not sure if it should be part of the "send" command, or if I should send the image in it's own "send" call.
Any help will be greatly appreciated!
Thanks!