Tech help beeminding OmniFocus

I think the overdue count is useful - I was hoping to add a ‘do less’ goal
to prevent me from letting things get overdue. If my overdue count is
greater than zero it means I either lied to myself about the due date or I
really didn’t do something that I should have. In both cases I’d like
Beeminder to sting me (more the former than the latter, since it should
have its own sting)

That’s kind of my thinking too. But if your Beeminder goal only goes eep! the day after something was due, then we akratics are likely to treat that as the real deadline.

That’s why I think I’d prefer a setting that checked for due items rather than overdue items; today is the day to do it without penalty.

Either way, watch out for the interaction between the due-date-time in OmniFocus and the goal’s deadline time. You don’t want something to pop onto the bee-radar just before bed and derail you.

Related: various folks have asked about beeminding random input, i.e. giving yourself 24h after a trigger event to deal with it. There’s no great solution for that currently.

1 Like

I think you’re right. At the moment, though I’m trying to Beemind the reduction of a backlog (as well as the lessening of the tendency to let things get overdue). Then I figured I could change the criteria, but keep the same graph (with good commenting to make it easy to pull the data apart later).

I wonder if your script could be tweaked for OmniPlan as well. That would be about 40 times more valuable for me (and the OmniFocus one is already plenty valuable!), but I don’t have time to try to work it out this week. After that, though I might see if I can piggyback off of what you’ve done and change it enough to make both work exactly the way I want them to. Thanks for sharing this.

1 Like

Ooh, I should try OmniPlan again. It was always overkill for my old life, but might make sense in the new world. Let us know how you get on.

1 Like

Yeah I love OmniPlan, but it’s hard to keep track of how much I’m getting done with it. In fact, I can’t really find a good system for Beeminding to-dos. I’ve tried a lot of things, but they all require so much tracking time that the friction is too high to be worth it.

By the way, what’s “muflax’s bmndr script”?

1 Like

It’s a defunct integration between Anki desktop and Beeminder. You can find forks of it still on GitHub, as discussed here.

But that’s not what I meant to write in the comment! (fixed now, thanks)

Should have been lydgate’s bmndr script, a python command-line interface for submitting data points. Or my fork of it, or any other way of submitting datapoints via script, of course.

1 Like

Thanks @philip. I’m looking forward to working on getting this set up. I need some kind of connection to my to do list so that i make sure those tasks keep moving!

Great discussion. How did you end up with connecting OmniFocus with Beeminder?

@bcool : my setup hasn’t changed much since I described it above

I’ve subsequently changed my goal’s deadline to noon, and tweaked the script to match. But it’s still that same chunk of AppleScript doing the work of interacting with OmniFocus.

My use of OmniFocus has changed, I now use it mostly as a tickler file to add deferred tasks to my working list, and as a master list for doing (so-called) weekly reviews.

2 Likes

@philip
I’ve put together a script to mind my overdue hours on OmniPlan projects. Do you know how to select a particular file with applescript? I suspect that’s something you didn’t have to do for the OmniFocus script, but I thought I’d ask just in case you knew and it was easily translatable for OmniPlan, cause I’m just using the front document, which definitely isn’t as convenient, and my attempts at figuring out how to specify project files have been thwarted!

1 Like

Hi MCM!

No idea, sorry. All of my Omni AppleScript knowledge came from searching for examples and experimenting with fragments until it seemed to do what I wanted. I can’t claim to have penetrated any Mystery…

Worth saying in case you don’t know, that there’s an OmniGroup Forum that may have samples or answers.

1 Like

I’m just going the easy way and using
open “/Users/…/filename.oplx”
delay 5
tell front document of application “OmniPlan”
[the things I want it to do go here]

and then closing it before doing it again with another project. Easier than figuring it out and works just as well. I’ve basically got a script now that can open each of my OmniPlan projects, get the hours of overdue tasks (by summing the “effort” for each overdue task) and then sending it vie emails to each “keep under some number” goal that encourages me to slowly chip away at any backlog while keeping up with tasks that are coming due.

2 Likes

I’ve just started trying to Beemind my own OmniFocus usage and I think I’ve got a good basic approach sorted out:

  • Use Hazel to trigger sending datapoints when OmniFocus syncs.
  • Use JavaScript for Applications (JXA) to avoid the monstrosity of AppleScript.
  • Use Node and the osa2 module to wrap JXA calls with a more general programming environment.

So far, the only thing I’ve got automated is my inbox count, but I also intend to add some support to beemind-arbitrary-things (i.e. did I check off a task containing the words “gratitude journal”). You can see the work-in-progress at dehowell/beeminding-omnifocus.

This is the Hazel rule I’m using to trigger the script:

That rule runs in the folder ~/Library/Containers/com.omnigroup.OmniFocus3/Data/Library/Application Support. Note that I am using the OmniFocus 3 beta, so YMMV if you are using OmniFocus 2. Either way, you’ll need the Pro version for AppleScript support.

JXA can do almost everything AppleScript can do, but with JavaScript. Some things still look magical and weird, but getting the inbox count is at least straightforward:

Application("OmniFocus").defaultDocument.inboxTasks().length
3 Likes

I renamed the repo to omniminder and it is now much more likely to be usable by someone else, if anyone wants to give it a whirl. As of right now, it supports:

  • Beeminding size of OmniFocus inbox
  • Beeminding number of projects that are due for a review
  • Beeminding arbitrary daily tasks that match a pattern (somewhat like how Complice supports beeminding arbitrary things)
2 Likes

WARNING! I have a goal for tracking this and it is turned out to be vulnerable to spurious derails. OmniFocus projects become “due for review” at midnight, no matter what time of day they were last reviewed. So I’ve a had a couple of instances now where a critical mass of projects all went due for review at the same time at midnight, just in time for my goal to derail (but not in time for me to get get any notification that it’s going to happen!)

If you end up doing something similar, I highly suggest setting your goal deadline to sometime in the middle of the day, so that you have some lead time to deal with pending reviews.

1 Like

Or perhaps even just at 23:59. I have many of my goals set to that simply because my brain isn’t very good at recognising the difference between 12:00 AM and 12:00 PM…

2 Likes

I wonder if you can help, I am having difficulty implementing Omniminder to Beeminder my Omnifocus tasks.

I am currently running Omnifocus using 3.11.1 (v149.5.0) on macOS BigSur v11.0.1 and have created a folder called .omnifocus under $HOME. I added my auth_code to $HOME/.omniminder/config.json and installed nvm and node using Homebrew.

I have also set up a ‘Do More’ goal in Beeminder called ‘gratitude’ and then created the $HOME/.logs folder. Next, I created a Hazel rule against the Omnifocus folder containing the lock file ‘OmniFocus.ofocus-lock’. The apple script for when the script is run contains the following:

export NVM_DIR="$HOME/.nvm"
. "/usr/local/opt/nvm/nvm.sh"

omniminder >> /Users/*****/.logs/omniminder.log 2>&1

I then created a project in Omnifocus project called ‘Routines’ to match what is written in the config.json file containing the following tasks:

  • ‘Write in gratitude journal’
  • ‘Write in gratitude journal 1’
  • ‘Write in gratitude journal 2’
  • ‘Write in gratitude journal 3’

Three of these tasks were completed and then synced in Omnifocus. However, Omniminder command did not update the goal in Beeminder as I expected. I’m not sure what I am doing wrong. I appreciate any help you can provide.

Many thanks

Was there anything in the log file /Users/*****/.logs/omniminder.log here? Also, I don’t think my instructions said this explicitly, but you will probably have to create the .logs directory.

Honestly, I haven’t personally been using omniminder for awhile. Running the omniminder command in the terminal still works fine on my machine, but I am not on Big Sur yet. I’d recommend trying to narrow down whether the problem is with the omniminder command itself or in the Hazel rule.

Running the script when the file OmniFocus.ofocus updates is a bit of a hack, for example, and the Omni Group might have moved the file or changed how they track changes for syncing. If that happened, your Hazel rule may just not be triggering.

1 Like

@dehowell
Thank you for your response. The issue is related to running omniminder rather than Hazel as I tried to get it to work before implementing the Hazel rule. I included the Hazel rule in my post for completeness.

I previously created the .log directory under $HOME and there was a /Users/*****/.logs/omniminder.log file. A portion of the log file indicates that it cannot find the ‘beeminder’ module:

node:internal/modules/cjs/loader:928
  throw err;
  ^

Error: Cannot find module 'beeminder'
…

Although I am not sure why? Any ideas?

Oh, that sounds like a problem with JavaScript resolving the dependencies when Hazel runs. In the screenshot of my Hazel rule up above, you’ll see that I’m explicitly setting the NVM path, running the NVM setup script, and providing the precise path the to the omniminder executable. That’s all for the sake of making sure Node is initialized properly to find the libraries the script depends on.

Those sorts of things are going to be particular to how you’ve installed Node on your system, so I can’t really tell you what the right configuration is for you. But I hope that gets you in the right direction, and good luck!