Thread: Customized sync
View Single Post
Hi,

I'm pretty new to applescripts but with some learning of the basics I managed to create a customized syncing for OmniFocus from to toolbar. Here's the script in all its simplicity:
Code:
tell front document of application "OmniFocus" to ical_synchronize

tell application "System Events" to set iSyncWasRunning 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 (not iSyncWasRunning and sync status is 2) then quit
end tell

tell front document of application "OmniFocus" to ical_synchronize
The purpose of the iSyncWasRunning is to leave the iSync open if it already was open. This scripts seems to work fine but it isn't as interactive as I would hope. While the iSync is running the OmniFocus is non-responsive and remains that way until the script has been run. The non-responsiveness isn't the problem, it is the fact that OmniFocus does not respond but yet it seems that everything is ok. After the script has been executed, every click event seems to go through.

I just thought I'd ask if anyone knows a way to either somehow to lock the OmniFocus (as with the "Sync with iCal", the notification) or to run the script on background and leave the OmniFocus idle for events and such.