Q: Need applescript for Messages to send Passbook .pkpass attachments
Hi - I'm trying to write an applescript to send iMessages to a list of recipient Phone numbers with Passbook .pkpass files as attachments.
Here's my simple sendMessage.applescript file
on run {targetBuddyPhone, targetMessage, targetFile}
tell application "Messages"
set targetService to 1st service whose service type = iMessage
set targetBuddy to buddy targetBuddyPhone of targetService
send targetMessage to targetBuddy
send file targetFile to targetBuddy
end tell
end run
I'm calling this from Terminal with command:
osascript sendMessage.applescript <Phonenumber> "Here's your Passbook coupon" Coupon.pkpass
When I execute the command, my targetMessage is correctly sent. However, the .pkpass file transfer says it is waiting for the recipient to accept the file transfer.
When I send it to my own iPhone, I don't receive any request to accept a file transfer.
How can I modify this script such that the file is properly attached to the iMessage and it sends with an auto-accept condition ?
Thanks if you can help,
Andrew
Mac mini, OS X Mountain Lion (10.8.3)
Posted on Nov 2, 2013 2:58 PM