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
#!/usr/bin/env osascript | |
-- Version 2, now with attachments! | |
-- Note, the first couple times you run this script, the Messages app may prompt you to approve a couple things, one of which will be the ability to send SMS messages through your phone | |
-- Run via osascript on the command line like this: | |
-- osascript sendText.scpt --to ########## "this is" "a text message" --attachment "/path/to/image.png" "sent via applescript" | |
-- Where ########## is the phone number to send to | |
-- If you leave out `--to ##########`, it defaults to the value of an environment variable named MYPHONE in your .bashrc file (add the line "export MYPHONE=##########" to ~/.bashrc, entering your default phone number in place of ##########) | |
-- The 3 quoted strings will appear on separate lines and the image will be inserted between the lines "a text message" and "sent via applescript" | |
on run argv |