Skip to content

Instantly share code, notes, and snippets.

@iracooke
Created September 24, 2014 19:59
Show Gist options
  • Save iracooke/89342a37d3829631fdc5 to your computer and use it in GitHub Desktop.
Save iracooke/89342a37d3829631fdc5 to your computer and use it in GitHub Desktop.
DropSync Scripts
(* Running a sync using DropSync and Applescript
Demonstrates how to launch DropSync, select a folder pair for syncing, and then run a sync. DropSync supports much more applescript functionality than is demonstrated here. Consult the DropSync.sdef file for complete details.
To use this script you will need to modify it to reflect your own setup. The Applescript Editor utility can be used to run, edit and debug your scripts.
The script can then be run from terminal using the osascript command, or can be automatically launched by linking it to a recurring event in iCal.
*)
tell application "DropSync 3"
launch
(* Select the folder pair (store) the you want to sync by using its name *)
set currentStore to store named "mudflats"
(* Initiate the sync in the desired direction *)
sync currentStore direction Downward
(* All the steps below are only required if you want to wait for the sync to complete and quit DropSync when the sync is finished *)
set timeused to 0
set timeoutsecs to 7200 -- 2 hours
(* Poll every 10 seconds to see if we are complete *)
repeat until syncing of currentStore is equal to false or timeused > timeoutsecs
delay 10
timeused = timeused + 10
end repeat
(* Tell Dropsync to quit if it is finished the sync *)
if syncing of currentStore is equal to false then quit
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment