Scripting syntax

The SMS Mac Scripting Application allows you to send an SMS from AppleScript. The syntax is:

                     tell application "SMS Mac Scripting"
                           set account to ""
                           set pin to "1234"
                           set logging to true
                           set report email to ""
                           set m to make new outgoing sms with properties {flash:false}
                           tell m
                                 set message to "Don't forget to go to the dry cleaner!"
                                 set recipients to {"+12345678900", "+1345678901"}
                                 set sender to "+14567890123"
                                 set delivery report to true
                                 set email receipt to true
                                 on error errMsg number errNum
                                       display dialog "Error: " & errNum & ". " & errMsg
                                 end try
                           end tell
                     end tell

All the details of the syntax are listed in the Scripting Dictionary. To see it, choose Open Dictionary... from the File menu in Script Editor and select the SMS Mac Scripting application.

You can put a list of mobile numbers in the recipients attribute. The message will be sent to all the list members.

You can put an email address in the sender attribute. It is the equivalent of the Reply to Email preference. Replies to the SMS will then go to that email address.

You can get your SMS balance reading the balance attribute of the application object. Since the balance information is in the server response, execute this line after sending the SMS.

You don't need to put the account ID and PIN in the script. If the account info is absent it will be read from the Keychain. This allows you to share your scripts without giving out your account info. The line of code containing the logging statement, is only recommendable during the debugging of your script.

Important 1: make sure you run your script in your test cycle at least once and give the SMS Mac Scripting Application permission ("Always Allow") to access the Keychain. It needs to query your PIN code from the Keychain if you don't supply it in the script.

Important 2: besides reading your account information (Account ID and PIN), the SMS Mac Scripting Application does not read any other preferences. So, you will need to set the sender property of the SMS explicitly in the script.

Tip: to test your script without sending an SMS put "--" in front of the send command.

Home Page


Address Book Plugin:
Mac OS X 10.3 and up
Send SMS Widget:
Mac OS X 10.4 and up
Yahoo! Widget:
Windows XP, 2000

Discussion List