Skip to content

Instantly share code, notes, and snippets.

@n8henrie
Last active July 10, 2022 14:54
Show Gist options
  • Save n8henrie/5307970 to your computer and use it in GitHub Desktop.
Save n8henrie/5307970 to your computer and use it in GitHub Desktop.
Send an iMessage to a buddy with Quicksilver. First pane: pick buddy and arrow in to select the correct phone number. Second pane: choose this action. Third pane: Enter text to send.
property appleID : "yourAppleID"
(*
See post at: http://n8henrie.com/2013/04/send-imessage-messages-with-quicksilver
Send an iMessage to a buddy with Quicksilver.
Install by placing in ~/Library/Application Support/Quicksilver/Actions and restarting Quicksilver
First pane: pick buddy from contacts and right arrow in to select the correct phone number (or just type the phone number as text)
Second pane: choose this action.
Third pane: Enter text to send.
Update Apr 26, 2013:
Was taught about "ABPeopleUIDsPboardType" by @p_j_r
Reversed order, so it now accepts text in the first pane and contacts in the third.
This way, you can return text to QS from another script (e.g. a hyperlink, text from "get selection")
and text it to a friend.
Pending issue: Would be great to figure out how to use either, but since both panes require a string,
I don't know how to make a switch that differentiates the two. Hit me up if you have ideas.
Update Apr 27, 2013:
After -> into contact, now only displays emails and phones (without addresses, etc.)
Thanks to @p_j_r for this as well.
*)
using terms from application "Quicksilver"
on get direct types
return {"NSStringPboardType"}
end get direct types
on get indirect types
return {"qs.contact.phone", "qs.contact.email"}
end get indirect types
on process text firstPane with thirdPane
if appleID is "yourAppleID" then
display dialog "You need to open the \"Send with Messages\" Action script and set your Apple ID. Exiting."
return
else
try
tell application "Messages"
tell (first account whose (service type is iMessage and description is ("E:" & appleID)))
login
send firstPane to participant thirdPane
end tell
end tell
on error a number b
activate
display dialog a with title "error with your QS action script"
end try
end if
end process text
on get argument count
return 2
end get argument count
end using terms from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment