Available Events and Parameters
EventScripts can pass information to both AppleScripts and shell scripts that provide more detail about the event that triggered the script. For AppleScripts these are passed as a record of properties, for shell scripts arguments are passed.
The tables below show the property names and arguments for all the events supported by EventScripts. Ensure your copy of EventScripts is up to date to get the complete list of events.
Example scripts demonstrating how the parameters are passed from EventScripts to both AppleScripts and shell scripts are available here.
Mobile Events
The event EventScripts Mobile will cause the script to be displayed in the iOS app EventScripts mobile. This lets you trigger the script from your iPhone, iPad or iPod touch. The EventScripts Mobile client found and EventScripts Mobile client lost are triggered when an EventScripts iOS client connects or disconnects from the server.
Mobile Events | AppleScript Record Properties | Shell Script Arguments |
---|---|---|
EventScripts Mobile | trigger scriptPath tagName | $1$2 $3 |
EventScripts Mobile client found | trigger scriptPath tagName | $1$2 $3 |
EventScripts Mobile client lost | trigger scriptPath tagName | $1$2 $3 |
Location Events
This event is triggered when Core Location detects a change in your current location. EventScripts passes your previous and current location to any scripts that it executes.
Location Events | AppleScript Record Properties | Shell Script Arguments |
---|---|---|
Location updated | trigger previousLatitude previousLongitude latitude longitude scriptPath tagName | $1 $2 $3 $4 $5 $6 $7 |
Network Events
These events let you trigger scripts when your network configuration changes. EventScripts uses its own dedicated external IP resolution service, as well as that supplied by Akamai to detect when your real world IP address changes for the External IP address changed event.
Network Events | AppleScript Record Properties | Shell Script Arguments |
---|---|---|
Internet became available | trigger scriptPath tagName | $1 $2 $3 |
Internet became unavailable | trigger scriptPath tagName | $1 $2 $3 |
External IP address changed | trigger previousAddress ipAddress scriptPath tagName | $1 $2 $3 $4 $5 |
Wireless network changed | trigger SSID previousSSID BSSID scriptPath tagName | $1 $2 $3 $4 $5 $6 |
Volume & USB Events
The volume events are triggered before and after OS X mounts an external volume or server. The volume name and path is supplied to any scripts EventScripts executes. The USB events are triggered as devices are added and removed. The passed parameters include the USB device name.
Volume Events | AppleScript Record Properties | Shell Script Arguments |
---|---|---|
Volume mounted | trigger volumeName volumePath scriptPath tagName | $1 $2 $3 $4 $5 |
Volume will unmount | trigger volumeName volumePath scriptPath tagName | $1 $2 $3 $4 $5 |
Volume unmounted | trigger volumeName volumePath scriptPath tagName | $1 $2 $3 $4 $5 |
USB Events | AppleScript Record Properties | Shell Script Arguments |
---|---|---|
USB device attached | trigger deviceName scriptPath tagName | $1$2$3 $4 |
USB device removed | trigger deviceName scriptPath tagName | $1$2$3 $4 |
Computer Events
These events let you trigger scripts when your computer sleeps, wakes and is shutdown. The Computer will sleep attempts to delay sleep to allow the script to be executed, but ultimately does not prevent sleeping. If you are only after an application to trigger scripts when your computer is put to sleep, then check out SleepWatcher for a free alternative to EventScripts.
Computer Events | AppleScript Record Properties | Shell Script Arguments |
---|---|---|
Computer will shutdown | trigger scriptPath tagName | $1$2 $3 |
Computer will sleep | trigger scriptPath tagName | $1$2 $3 |
Computer wakes | trigger scriptPath tagName | $1$2 $3 |
Power Events
The Power switched to battery event is only appropriate to MacBooks. The other two events should also be triggered on desktops if you swap between mains power and a UPS system that is recognised natively by Mac OS X.
Power Events | AppleScript Record Properties | Shell Script Arguments |
---|---|---|
Power switched to mains | trigger scriptPath tagName | $1$2 $3 |
Power switched to battery | trigger scriptPath tagName | $1$2 $3 |
Power switched to UPS | trigger scriptPath tagName | $1$2 $3 |
General Events
Oooh! Look! Motion detection! Yup - EventScripts has motion detection, which uses the iSight camera to look for motion. Won't work if you don't have an iSight camera. Very useful for, er...
General Events | AppleScript Record Properties | Shell Script Arguments |
---|---|---|
Screenshot taken | trigger screenshotName screenshotPath screenshotType scriptPath tagName | $1 $2 $3 $4 $5 $6 |
Desktop picture changed | trigger imagePath scriptPath tagName | $1 $2 $3 $4 |
Motion detected | trigger scriptPath tagName | $1$2 $3 |
Audio Events
You can trigger actions in EventScripts when headphones are attached or removed from your Mac. This has been tested with onboard audio hardware only.
Audio Events | AppleScript Record Properties | Shell Script Arguments |
---|---|---|
Headphones connected | trigger scriptPath tagName | $1$2 $3 |
Headphones disconnected | trigger scriptPath tagName | $1$2 $3 |
Spaces Events
Spaces Events | AppleScript Record Properties | Shell Script Arguments |
---|---|---|
Spaces changed | trigger scriptPath tagName | $1$2 $3 |
Entered fullscreen | trigger bundleCode applicationName applicationPath scriptPath tagName | $1 $2 $3 $4 $5 $6 |
Download Events
Many applications (Safari, Transmission, etc.) post notifications to let the system know that a file has been downloaded. You can trigger events when EventScripts hears these notifications.
Download Events | AppleScript Record Properties | Shell Script Arguments |
---|---|---|
File Downloaded | trigger downloadedFile scriptPath tagName | $1 $2 $3 $4 |
Apple Remote Events
Should work if you Mac can be controlled by an Apple Remote (not all can, in which case use EventScripts Mobile and your iPhone!). These events are powered by the excellent remote framework from iospirit, makers of Remote Buddy. If you need more sophisticated control of remotes than EventScripts can provide, you should really check out Remote Buddy.
Apple Remote Events | AppleScript Record Properties | Shell Script Arguments |
---|---|---|
Apple Remote Up | trigger buttonHeld scriptPath tagName | $1 $2 $3 $4 |
Apple Remote Down | trigger buttonHeld scriptPath tagName | $1 $2 $3 $4 |
Apple Remote Left | trigger buttonHeld scriptPath tagName | $1 $2 $3 $4 |
Apple Remote Right | trigger buttonHeld scriptPath tagName | $1 $2 $3 $4 |
Apple Remote Center | trigger buttonHeld scriptPath tagName | $1 $2 $3 $4 |
Apple Remote Play/Pause | trigger buttonHeld scriptPath tagName | $1 $2 $3 $4 |
Apple Remote Menu | trigger buttonHeld scriptPath tagName | $1 $2 $3 $4 |
Bluetooth Events
Bluetooth Events | AppleScript Record Properties | Shell Script Arguments |
---|---|---|
Bluetooth became available | trigger scriptPath tagName | $1 $2 $3 |
Bluetooth became unavailable | trigger scriptPath tagName | $1 $2 $3 |
Bluetooth device found | trigger deviceName deviceAddress scriptPath tagName | $1 $2 $3 $4 $5 |
Bluetooth device lost | trigger deviceName deviceAddress scriptPath tagName | $1 $2 $3 $4 $5 |
Backup Events
These events are triggered when backups are completed, or when the backup volume is mounted.
Time Machine Events | AppleScript Record Properties | Shell Script Arguments |
---|---|---|
Time Machine backup completed | trigger backupPath scriptPath tagName | $1 $2 $3 $4 |
Time Machine volume mounted | trigger backupVolume scriptPath tagName | $1 $2 $3 $4 |
Screen Events
Recent additions to this suite are the Screen was added, Screen was removed and the Screen configuration changed event.
Screen Events | AppleScript Record Properties | Shell Script Arguments |
---|---|---|
Screensaver started | trigger scriptPath tagName | $1$2 $3 |
Screensaver will stop | trigger scriptPath tagName | $1$2 $3 |
Screensaver stopped | trigger scriptPath tagName | $1$2 $3 |
Screen did sleep | trigger scriptPath tagName | $1$2 $3 |
Screen did wake | trigger scriptPath tagName | $1$2 $3 |
Screen password locked | trigger scriptPath tagName | $1$2 $3 |
Screen password unlocked | trigger scriptPath tagName | $1$2 $3 |
Screen was added | trigger scriptPath tagName | $1$2 $3 |
Screen was removed | trigger scriptPath tagName | $1$2 $3 |
Screen configuration changed | trigger scriptPath tagName | $1$2 $3 |
Application Events
Application Events | AppleScript Record Properties | Shell Script Arguments |
---|---|---|
Application activated | trigger bundleCode applicationName applicationPath scriptPath tagName | $1 $2 $3 $4 $5 $6 |
Application deactivated | trigger bundleCode applicationName applicationPath scriptPath tagName | $1 $2 $3 $4 $5 $6 |
Application will launch | trigger bundleCode applicationName applicationPath scriptPath tagName | $1 $2 $3 $4 $5 $6 |
Application launched | trigger bundleCode applicationName applicationPath scriptPath tagName | $1 $2 $3 $4 $5 $6 |
Application quit | trigger bundleCode applicationName applicationPath scriptPath tagName | $1 $2 $3 $4 $5 $6 |
EventScripts launched | trigger bundleCode applicationName applicationPath scriptPath tagName | $1 $2 $3 $4 $5 $6 |
EventScripts quit | trigger bundleCode applicationName applicationPath scriptPath tagName | $1 $2 $3 $4 $5 $6 |
Browser Events
Browser Events | AppleScript Record Properties | Shell Script Arguments |
---|---|---|
Safari will launch | trigger bundleCode applicationName applicationPath scriptPath tagName | $1 $2 $3 $4 $5 $6 |
Safari launched | trigger bundleCode applicationName applicationPath scriptPath tagName | $1 $2 $3 $4 $5 $6 |
Safari quit | trigger bundleCode applicationName applicationPath scriptPath tagName | $1 $2 $3 $4 $5 $6 |
Firefox will launch | trigger bundleCode applicationName applicationPath scriptPath tagName | $1 $2 $3 $4 $5 $6 |
Firefox launched | trigger bundleCode applicationName applicationPath scriptPath tagName | $1 $2 $3 $4 $5 $6 |
Firefox quit | trigger bundleCode applicationName applicationPath scriptPath tagName | $1 $2 $3 $4 $5 $6 |
Google Chrome will launch | trigger bundleCode applicationName applicationPath scriptPath tagName | $1 $2 $3 $4 $5 $6 |
Google Chrome launched | trigger bundleCode applicationName applicationPath scriptPath tagName | $1 $2 $3 $4 $5 $6 |
Google Chrome quit | trigger bundleCode applicationName applicationPath scriptPath tagName | $1 $2 $3 $4 $5 $6 |
iTunes Events
iTunes Events | AppleScript Record Properties | Shell Script Arguments |
---|---|---|
iTunes track changed | trigger album track artist scriptPath tagName | $1 $2 $3 $4 $5 $6 |
iTunes will launch | trigger bundleCode applicationName applicationPath scriptPath tagName | $1 $2 $3 $4 $5 $6 |
iTunes launched | trigger bundleCode applicationName applicationPath scriptPath tagName | $1 $2 $3 $4 $5 $6 |
iTunes quit | trigger bundleCode applicationName applicationPath scriptPath tagName | $1 $2 $3 $4 $5 $6 |