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.


# 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

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


# 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

/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" "">
<plist version="1.0">

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.


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

1 Like