Turns out that OmniFocus Pro has AppleScript support. I just wrote this to auto-mind the size of my inbox using Hazel and the bmndr commandline script.
#!/bin/bash
# this sends your OmniFocus inbox count to Beeminder
# requires: OmniFocus Pro, lydgate's bmndr script
# optional: hazel or cron scheduling
BMNDR=bmndr
GOAL_SLUG=omnifocus
COUNT_FILE=OmniFocus.count
if [ ! -f $COUNT_FILE ] ; then
echo -n 0 > $COUNT_FILE
fi
# make the file 'today' be 'midnight'
/usr/bin/touch -t $(/bin/date +%m%d0000) today
INBOX_COUNT=$(/usr/bin/osascript -e '
tell front document of application "OmniFocus"
set theTasks to every inbox task whose blocked is false and completed is false
set theCount to count of theTasks
end tell
return theCount
')
# if the count has changed, or not been sent yet today
if [ $INBOX_COUNT -ne $(cat $COUNT_FILE) -o today -nt $COUNT_FILE ] ; then
$BMNDR $GOAL_SLUG $INBOX_COUNT OmniFocus inbox count at $(/bin/date +%H:%M)
echo -n $INBOX_COUNT > $COUNT_FILE
fi
UPDATE: now sends a datapoint if the day has changed, as well as if the count has changed. Also, I no longer watch the particular file, but have set up a more general cron-like folder using Hazel, but that seems a step too far for this forum!