Last active
May 17, 2018 06:33
-
-
Save ajitam/dcf16641ff0b9a221dc44f52d0f86611 to your computer and use it in GitHub Desktop.
This file contains 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
-- Send iMesage with AppleScript | |
-- @description This script open Messages application and sends iMessage to | |
-- specific apple id. | |
-- | |
-- @note Before run go to Messages and create the conversation (aka. send one | |
-- message) | |
-- | |
-- @run osascript sendAppleMessage.applescript "user@email.com" "This is an iMessage send from applescript" | |
on run {sndAppleID, sndMessage} | |
tell application "Messages" | |
-- get and set myAppleID | |
set myAppleID to get id of first service | |
-- set receiver | |
set receiver to buddy sndAppleID of service id myAppleID | |
-- send message | |
send sndMessage to receiver | |
-- hide the window | |
tell application "System Events" to set visible of process "Messages" to false | |
end tell | |
end run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment