Scripting with AppleScript

For advanced users, Shion.app ships with a full AppleScript dictionary for controlling your devices using the Mac’s native scripting technology. While the full extent of this functionality is beyond the scope of this document (see the dictionary via AppleScript Editor), the scripts below show how to accomplish some common tasks.

Toggle a device:

tell application "Shion"

    deactivate device "Overhead Light"
    activate device "Overhead Light"

end tell

Get the state of a lamp:

tell application "Shion"

    level of device "Overhead Light"

end tell

Execute a snapshot:

tell application "Shion"

    execute snapshot "Overhead Off"

end tell

For more functions, see the Shion AppleScript dictionary. If there are functions missing from the dictionary that you would like implemented, please let us know.