Things3 to Beeminder (ToDoZero)

Inspired by @k1rsty’s Beeminding by k1rsty, I realized that I’d not posted my own inboxzero setup for todos.

On a Mac, using Things3, but this approach should generalize to anything that has an AppleScript interface, such as Apple Mail.

#!/bin/sh

# send the number of items in the Things today list to Beeminder

applescript=$(cat <<END

tell application "Things3"
	set todoCount to 0
	repeat with itemToDo in to dos of list "Today"
		set todoCount to todoCount + 1
	end repeat
	--display dialog todoCount
	return todoCount
end tell

END
)
count=$(echo "$applescript" | /usr/bin/osascript)


MEMORY=/Users/philip/src/bmndr/.thingszero.lastcount
TODAY=/Users/philip/src/bmndr/.today.date

# make a midnight comparison file
/usr/bin/touch -t $(/bin/date +%m%d)0000 "$TODAY"

if [ "$MEMORY" -nt "$TODAY" ] ; then
  # exists and is from today - check value
  lastcount=$(cat "$MEMORY")
  if [ $count -eq $lastcount ] ; then
    # no update required
    exit 0
  fi
fi

/Users/philip/bin/bmndr thingszero $count && echo $count > "$MEMORY"


You’ll have to adjust that to fit your own directory structure and whatever command line thing you use to send datapoints to Beeminder.

And then to run it every few minutes I added this to ~/Library/LaunchAgents/net.hellyer.thingszero.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>Label</key>
    <string>net.hellyer.thingszero</string>
    <key>Program</key>
    <string>/Users/philip/src/bmndr/thingszero.sh</string>
    <key>StartInterval</key>
    <integer>327</integer>
    <key>RunAtLoad</key>
      <true/>
  </dict>
</plist>

Because it runs every few minutes, if I set the graph to plot all datapoints, I get a sense of how things progressed over the day. That’s a custom setting, so you’d have to change the goal type to custom, which in turn requires a premium plan.

4 Likes

Very nice.
Alternative idea: under the hood Things3 uses SQLite database.

4 Likes

Things 3 has great interface for iOS shortcuts.

You can run action each evening to check if your todo list is empty or log progress on some project, check if you’ve eaten the frog etc. Very powerful integration.

4 Likes

do you have made use of it?

I did, but it didn’t click for me.
I kept it for a few weeks but ultimately dropped. It doesn’t make any sense to use beeminder as a reminder. Also, on some days I don’t have any tasks. Then what. I can’t build up the buffer.

would you mind sharing how you used it technically? I think if you just do zero it it could work for me. I am now really enthusiastic but could also run into the same insights like you. Just wanna learn it.

1 Like

I don’t remember exactly, but when you open Shortcuts on iOS, then you select Things3, you can get a list of tasks to do in a project or today. If a list is empty, you can add a datapoint to Beeminder. Then, you can schedule shortcut to run automatically each day at 23:45.

1 Like