Synchronize. Backup. Bootable Backup.
Whatever your backup or sync scenario, ChronoSync has got you covered!
Back to more tech notes

MORE TECH NOTES

TNCS-0012 - Automatically Shut Down Your Mac After Running a Sync

March 21, 2014

INTRODUCTION

ChronoSync does not directly support the automatic powering down of the Mac after running a sync. Use this document to create a post-synchronization AppleScript that will shut down the Mac upon completion of the sync document.

RESOLUTION

Use the following steps to create the post-sync AppleScript to shut down the Mac. This procedure makes use of the AppleScript Editor which be found in the Applications->Utilities folder.

  1. Open the AppleScript Editor

    Open the Utilities folder, found in the Applications folder of your Mac, then open the AppleScript Editor.

  2. Create the AppleScript

    Copy the following script and paste it into the AppleScript Editor:

    tell application "System Events"
    shut down
    end tell
    set quitResult to do shell script "ps axjww"
    if quitResult contains "Applications/ChronoSync" then
    do shell script "killall ChronoSync"
    delay 2
    end if
  3. Compile and Test

    Click the 'Compile' button in the AppleScript Editor toolbar. Check for any errors. Now, test the script. Remember, if everything works, the Mac will shut down! Now click the 'Run' toolbar button. Does the Mac shut down? Correct any errors before continuing.

  4. Save the AppleScript

    Save the AppleScript by going to the menubar and choosing File -> Save. Make sure to choose the 'Script' File Format if it is not chosen already. Choose a directory to store the AppleScript, then choose 'Save'. It may be helpful to keep any scripts in the same folder where the sync document is stored.

  5. Set the Script in Your Sync Document

    Open the saved sync document and switch to the Options Panel. Expand the 'Scripts' section.

    Enable 'Post-Synchronization script’, then click the ‘Choose’ button and select the AppleScript just created.

    Choose whether or not to abort the sync run if the AppleScript encounters an error by enabling or disabling ‘Abort on Script Errors’.

    Test the script by clicking 'Run'.

CONCLUSION

If all has gone well, the AppleScript should power down your Mac after running the sync.

REVISION HISTORY

Mar-21-2014 - Created from Internal Support Notes.