The Omni Group
These forums are now read-only. Please visit our new forums to participate in discussion. A new account will be required to post in the new forums. For more info on the switch, see this post. Thank you!

Go Back   The Omni Group Forums > OmniFocus > OmniFocus Extras
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
Customized sync Thread Tools Search this Thread Display Modes
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.
 
Are you running this as a toolbar script? If so the loop while you wait for isync will block OF. If you roll the the last 2 parts of your script into a standalone app, then have your script launch that, the OF will be more responsive.

-P
 
Quote:
Originally Posted by ptone View Post
Are you running this as a toolbar script?
Thanks for the reply and sorry, I forgot to mention this. Yeah, I'm running it manually from the toolbar (since the use of crontab or any other time-based scheduling only wores the battery of my cell phone).

Quote:
Originally Posted by ptone View Post
If you roll the the last 2 parts of your script into a standalone app, then have your script launch that, the OF will be more responsive.
So running a script from a script is sort of asynchronous? This is pretty new world to me. :)

I tried to look from the AppleScript Library but didn't found any methods to create those OmniFocus style messages (the ones that appear when loading or syncing). I was thinking that this way when the script would freeze the OmniFocus, it would initially trigger OmniFocus to show the message. I hope I'm making sense.
 
I'm sorry to bring this old topic up and that this isn't directly a matter of these forums, but I'm having trouble with the iSync.

It seems that if the device I'm trying to sync my notebook with is turned off, iSync seems to exit with status 2 (completed with no errors) regardless of the fact that the bluetooth of the device I'm trying to sync is turned off. Is there any way to determine if the connection to the device was failed?

As I previously mentioned, this is more of a problem with iSync, but I find these forums the most convenient way to ask this.

Thank you in advance :)
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Xcode 4 Customized Build Location jgarnham Omni Frameworks 4 2011-09-16 03:51 AM
Use same customized colors on iphone and mac mickh OmniFocus for iPhone 3 2009-11-30 03:55 PM
Problems with customized Google News Pages Dr. Smoke OmniWeb Bug Reports 2 2009-04-28 10:15 AM
Feature Request: Sync Customized Tool Bar / Preferences zaque OmniFocus Syncing 0 2008-08-15 06:49 AM


All times are GMT -8. The time now is 04:45 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.