Sunday, February 04, 2007

A better iSync script

The isync "script" I posted last time did work, but not as perfect as you might want, so here is a updated version! The new script starts iSync in the background, synchronizes and then exits iSync (if iSync was not running from the beginning, in that case the application will not be terminated).

tell application "Finder"
set iSyncRunning to (number of items in (processes whose name is "iSync") is greater than 0)
tell application "iSync" to launch
tell application "Finder" to set visible of process "iSync" to false
tell application "iSync" to synchronize
tell application "iSync"
repeat while (syncing is true)
end repeat
if iSyncRunning is not true then
end if
end tell
end tell

No comments: