Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thrashing Between Script and Sync? #24

Open
mark4flies opened this issue Apr 10, 2016 · 7 comments
Open

Thrashing Between Script and Sync? #24

mark4flies opened this issue Apr 10, 2016 · 7 comments

Comments

@mark4flies
Copy link

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.

@lemonmade
Copy link
Owner

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

@ThomRosario
Copy link

@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.

@mark4flies
Copy link
Author

Fantastic - thanks so much!

@mark4flies
Copy link
Author

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 mark4flies reopened this May 3, 2017
@ThomRosario
Copy link

ThomRosario commented May 3, 2017

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

@mark4flies
Copy link
Author

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!

@ThomRosario
Copy link

ThomRosario commented May 3, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants