# Script Examples

Thinking Home supports AppleScript with a complete dictionary, browsable with any script editor. What is not visible in the dictionary is that you can refer to devices in alternative ways. Just about any way will work. For example, the “turn on” examples below are all equivalent.

These are a few examples of AppleScript in Thinking Home.

## Referring to a device | -- You can work with devices any way you prefer tell application "Thinking Home" turn on the "Porch Light" turn on "P16" turn on device "Porch Light" turn on device 3 end tell tell the "Porch Light" of application "Thinking Home" turn on end tell tell application "Thinking Home" tell the "Porch Light" turn on end tell end tell
## Dimming & Brightening | -- Dimming and brightening is easy, too. tell application "Thinking Home" dim the "Porch Light"-- default is by 35% brighten the "Porch Light" by 80 -- percent dim the "Porch Light" to 20 -- percent end tell
## Sunrise & Sunset Times | tell application "Thinking Home" set mySunUp to the sunrise for the current date set mySundown to the sunset for the current date end tell