A template script for running a single sync from left to right on a folder pair called mudflats is shown below. The script code itself is relatively self explanatory. The first line opens the DropSync application if it isn't open already. Then we set a variable called currentStore to the folder pair we want to sync. A Store is equivalent to a Folder Pair. In this case the store is called "mudflats" and is one we have previously created using the GUI (It's also possible to create stores using AppleScript). The script assumes that a folder pair called "mudflats" exists in DropSync so you will need to change "mudflats" in the script to the name of a folder pair you have already configured. Subsequent lines initiate a sync and then wait a specified time, or until the sync is completed before quitting.
Note that this script launches DropSync at the start and quits DropSync when it is finished. If you want to leave DropSync running you should remove the line that says "launch" as well as the final line that tells DropSync to quit
(* 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 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 the Calendar app.
*)
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 DestinationRight
(* 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