Thrashing Between Script and Sync?
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.
I probably don't have time to do this myself, but I'd be happy to review and merge a PR with this fix.
@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.
Fantastic - thanks so much!
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!
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
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!
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.