I am trying to create a service that grabs the URL of some link, then create a blank iMessage with that URL in the body. Basically, I want to recreate that Message share feature in Safari in Mountain Lion, but with Reeder.app, specifically. "Copy Link" from the context menu doesn't always work, esp. when sending to a iphone, the URL drops, and all you get is the alias.

I've set up an Automator with Applescript, and I can definitely send a message to a buddy, if those things are specified. I'd prefer to populate that in iMessage, since I won't always be sending to the same person.

Below works, using set input as a proxy for automator's url grabbing at the moment.

set input to "http://aol.com"
tell application "Messages"
          set theBuddy to buddy "camelot@mac.com" of service "iCloud"
          send input to theBuddy
end tell

Also tried

tell application "Messages"
    set theBuddy to buddy "*" of service "iCloud"
    set input to invitation message of text chat of service "iCloud"
end tell

Both from https://discussions.apple.com/thread/3923965?start=0&tstart=0

  • Interestingly, in a workaround, using the two buddies will almost always use with 'send input to "buddy@me.com"', i get a working service. it is available in Safari for a URL, but it is not available in Reeder.app as a service for anything. It doesn't show in the context menu, it doesn't show up in Reeder > Services. Odd. Is this a Reeder issue? I noticed that my service is in "Internet" category in Services Manager...I would still rather have a blank iMessage with a URL in the text, so that I can amend if I want. – greenwar Sep 3 '12 at 9:19

You have to do it with UI scripting :

tell application "System Events" to tell process "Messages"
    set input to "http://aol.com" as text
    click button 1 of group 1 of splitter group 1 of window 1
    delay 1
    keystroke "Buddy@provider.com" -- type the reciever
    keystroke return -- validate the previous input
    keystroke tab -- move to message input
    keystroke input -- type the message
end tell

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.