Last active
December 7, 2017 21:25
-
-
Save c99koder/6773332 to your computer and use it in GitHub Desktop.
Forward iMessges to Pebble using PushOver. Fill in your APP_TOKEN and USER_KEY. In the "Alerts" tab of Messages' settings, tell it to run this script for "Message Received" and "Text Invitation"
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
| using terms from application "Messages" | |
| on message received theMessage from theBuddy for theChat | |
| my push((full name of theBuddy), theMessage) | |
| end message received | |
| on received text invitation theMessage from theBuddy for theChat | |
| my push((full name of theBuddy), theMessage) | |
| end received text invitation | |
| end using terms from | |
| on push(title, message) | |
| set APP_TOKEN to "..." | |
| set USER_KEY to "..." | |
| do shell script "curl -s -F token=" & APP_TOKEN & " -F user=" & USER_KEY & " -F title=\"" & title & "\" -F message=\"" & message & "\" https://api.pushover.net/1/messages.json" | |
| return | |
| end push |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for the work on this script! I recommend you change your curl script portion to use
quoted form ofinstead of escaping double quotes to avoid issues with special characters. Here's an example that uses each:Result:
