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

MORE TECH NOTES

TNCS-0015 - Automatically Run Your Sync via AppleScript

March 23, 2014

INTRODUCTION

Some users prefer to have an icon on their desktop that, when launched, automatically opens their sync document and runs it all in one action. Use this document to create an AppleScript that will open a saved sync document, run it, then save and close it.

RESOLUTION

Use the following steps to create the AppleScript to launch a sync. 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 "Finder" to open alias "Mavericks:Users:Hartigan:Desktop:Test.sync"
    tell application "ChronoSync"
    activate
    set myDocument to document "Test"
    tell myDocument
    Synchronize
    delay 1
    repeat while syncStatus is not 0
    delay 1
    end repeat
    save
    close
    end tell
    quit
    end tell

    Modify the path name in quotes after the term 'alias' to name the saved sync document, and modify "Test" after the term 'document' to the exact name of the saved sync document as displayed in the sync document's titlebar. (This would be the sync document name without any filename extension.)

  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 sync document should open and begin syncing! Now click the 'Run' toolbar button. Does the sync get launched? 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 'Application' File Format. Choose a directory to store the AppleScript, such as the Desktop, then choose Save.

CONCLUSION

If all has gone well, you should be able to open and run the saved sync document by double-clicking the AppleScript file you've just created.

REVISION HISTORY

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