Created
July 21, 2015 18:54
-
-
Save alekhinen/b3a112cfbb5cad70e6e2 to your computer and use it in GitHub Desktop.
Programmatically send iMessage via GUI through Terminal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on run {targetBuddyPhone, targetMessage} | |
tell application "System Events" | |
tell application "Messages" to activate | |
tell process "Messages" | |
click menu item "New Message" of menu "file" of menu bar 1 | |
set input to targetMessage as text | |
delay 1 | |
keystroke targetBuddyPhone | |
keystroke return | |
keystroke tab | |
keystroke input | |
keystroke return | |
end tell | |
end tell | |
end run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This will open up
Messages.app
and click through the UI to generate and send an iMessage.