templates icon indicating copy to clipboard operation
templates copied to clipboard

Thrashing Between Script and Sync?

Open mark4flies opened this issue 10 years ago • 7 comments

It seems that OmniFocus frequently syncs while the script is running. Their technical support pointed out that will autosave (Boolean) can be used to disable sync at the beginning and then re-enable it at the end to avoid this thrashing and speed things up.

mark4flies avatar Apr 10 '16 10:04 mark4flies

I probably don't have time to do this myself, but I'd be happy to review and merge a PR with this fix.

lemonmade avatar Apr 11 '16 21:04 lemonmade

@mark4flies I added in the lines you mentioned and the script executes instantaneously. I seriously can't click over onto the new project before all of the work is done.

ThomRosario avatar May 03 '17 12:05 ThomRosario

Fantastic - thanks so much!

mark4flies avatar May 03 '17 15:05 mark4flies

Sorry but I don't know AppleScript. How did you add these lines? I can open the script in the Script Editor but I do not know what to add or where to add it. Thanks!

mark4flies avatar May 03 '17 15:05 mark4flies

In the first main loop that starts with tell application "OmniFocus"

I moved down below the greyed out comments and added set will autosave to false

At the very end of that loop, you'll find: my syncit()

Right above that line, I entered: set will autosave to true

I ran into another issue w/ the script and ended up just giving up on it and using Curt Clifton's

ThomRosario avatar May 03 '17 16:05 ThomRosario

That was easy!

I just tested it with my most complex template and it was done (correctly, too!) in just a couple of seconds. The previous benchmark as about 8 minutes.

Thanks so much for your help!

mark4flies avatar May 03 '17 17:05 mark4flies

Wow. That's quite a speedup! I'm glad it works for you; I could never set due or start dates for any tasks without the script hanging =/

Keep in mind that if the script never gets back to the line where autosaving is true, then OmniFocus will start acting screwy. If you run it again w/ a simpler template, it should hit the autosave=true & begin working again.

ThomRosario avatar May 03 '17 18:05 ThomRosario