Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'An AppleScript to keep your devices in sync' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
An AppleScript to keep your devices in sync
Authored by: loren_ryter on Mar 02, '06 11:13:54PM
This is a very nice idea -- I always forget to sync my phone. I wish there were a way to attach this script or similar to the .Mac sync instead so they all sync at the same time -- or to a Palm sync for that matter. I find it annoying that all the syncs in Tiger are now separate. You could clean up the script a bit -- too many unnecessary tell blocks and it's much better not to tie up the Finder to get processes. Use system events instead. Also the repeat loop will eat CPU unnecessarily. Stick a delay in there. ie,

tell application "System Events" to set iSyncRunning to ¬
	(number of items in (processes whose name is "iSync") is greater than 0)
tell application "iSync"
	synchronize
	repeat while (syncing is true)
		delay 5
	end repeat
	if iSyncRunning is not true then quit
end tell
Also you can use a cron job to set other times other than two hours. Remember there is a nice GUI called Cronnix for Cron. You might also want to put the script in: ~/Library/Scripts/ instead of in Application Support, so you can run it manually from the script menu too. I don't know anything about launchd -- why would it be better than cron which is built in to OS X?

[ Reply to This | # ]
An AppleScript to keep your devices in sync
Authored by: christernl on Mar 03, '06 08:49:56AM

since 10.4 (correct me if Im wrong), Apple use launcd instead of cron thats why



[ Reply to This | # ]
An AppleScript to keep your devices in sync
Authored by: beauh on Mar 08, '06 09:41:54AM

cron is still there in 10.4, it's activated by launchd (com.vix.cron)

Seeing that cron is quite a bit easier to manage than launchd (by hand at least), there's no reason that cron isn't perfectly appropriate.

- b-



[ Reply to This | # ]
An AppleScript to keep your devices in sync
Authored by: sly_dog_jonah on Apr 23, '06 03:13:29AM
Here's my tweak of the above script, which keeps iSync open if there have been any errors in the sync process (e.g. Bluetooth dongle missing, phone out of range). The beauty of running from iCal is that if the computer is off or asleep at the time, the script will run upon wakeup. I'm not sure if the other automated running options above would work on wakeup, but iCal certainly does.

tell application "System Events" to set iSyncRunning to ¬
	(number of items in (processes whose name is "iSync") is greater than 0)
tell application "iSync"
	synchronize
	repeat while (syncing is true)
		delay 5
	end repeat
	if (iSyncRunning is not true and sync status is 2) then quit
end tell


[ Reply to This | # ]
An AppleScript to keep your devices in sync
Authored by: sky33940 on Feb 18, '07 07:04:08AM
Thanks. Works perfectly. Any idea on how to make a recurring event of less than one day in iCal? Jean

[ Reply to This | # ]
An AppleScript to keep your devices in sync
Authored by: schneecrash on Jan 19, '07 09:08:35AM

this script works perfectly. thanks!

what would i add to the script to get iSync to QUIT after a successful sync?

adding an "end run" results in an error:

Library/Scripts/iSync.scpt:393:400: execution error: end of ¬Â´script¬Âª doesn't understand the run message. (-1708)
thanks!

[ Reply to This | # ]