Mail Icon

AppleScript, Automator, and System Services Support

Use of WakeOnLan in AppleScript

    WakeOnLan understands two AppleScript commands, 'wakeup' and 'puttosleep'. If you use AppleScript to automate processes (e.g. backup), and you need to make sure remote computers you access are not sleeping, WakeOnLan can help. Just include the following lines in your AppleScript:



    Instead of '192.168.1.22' in the example above, use any computer name or IP address known by WakeOnLan. Make sure the spelling is exactly like it is in the WakeOnLan computer table. Note that 'puttosleep' will ask for the login passwords if they have not been remembered by Keychain.

Use of WakeOnLan in Automator

    Although WakeOnLan doesn't come with an Automator action yet, it's possible to use the 'wakeup' and 'puttosleep' actions within Automator using AppleScript. Just drag the 'Run AppleScript' action into your workflow, and type something like this:



    Instead of '192.168.1.1' in the example above, use any computer name or IP address known by WakeOnLan. Make sure the spelling is exactly like it is in the WakeOnLan computer table. Note that 'puttosleep' will ask for the login passwords if they have not been remembered by Keychain.

Use of WakeOnLan in System Services

    In any Mac OS X application, select any computer name or IP address and click either 'Wake Up Computer' or 'Put Computer To Sleep' from the 'Services/WakeOnLan' menu available in each application menu. For example, if you need to wake up a computer before connecting to it via 'Chicken of the VNC', select it's IP address and select 'Wake Up Computer' in the 'Services' submenu of the 'Chicken of the VNC' menu:



    Note that you need to select any computer name or IP address in a text field, selecting entries in lists does not work. Note that 'Put Computer To Sleep' will ask for the login passwords if they have not been remembered by Keychain.