Ich versuche, einen Dienst zu erstellen, der die URL eines Links erfasst, und dann eine leere iMessage mit dieser URL im Text zu erstellen. Grundsätzlich möchte ich diese Message-Share-Funktion in Safari in Mountain Lion nachbilden, aber speziell mit Reeder.app. "Link kopieren" aus dem Kontextmenü funktioniert nicht immer, insb. Beim Senden an ein iPhone wird die URL gelöscht, und Sie erhalten nur den Alias.
Ich habe einen Automator mit Applescript eingerichtet und kann definitiv eine Nachricht an einen Freund senden, wenn diese Dinge angegeben sind. Ich würde es vorziehen, das in iMessage zu füllen, da ich nicht immer an dieselbe Person sende.
Unten funktioniert, wobei die Set-Eingabe im Moment als Proxy für das URL-Erfassen des Automators verwendet wird.
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
Auch probiert
tell application "Messages"
set theBuddy to buddy "*" of service "iCloud"
set input to invitation message of text chat of service "iCloud"
end tell
Beide von https://discussions.apple.com/thread/3923965?start=0&tstart=0
Sie müssen es mit UI-Scripting tun:
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
Grünkrieg