OmniRPG is a simple AppleScript that counts the number of tasks completed over the last day within OmniFocus, then sends it to a set habit within HabitRPG. The script also tallies up completed tasks based on difficulty allowing for varying levels of reward.
The setup script (Setup.scpt) creates the three difficulty levels within HabitRPG. All you need to do is add your User ID and API Token to the dialog box when prompted. User ID and API Token which can be found here. Setup.scpt should only be ran once to avoid creating duplicate habits.
set API_USER to ""
set API_KEY to ""
On launching the main script OmniRPG.scpt a prompt appears with the option of logging tasks Today or Yesterday in a dialog box - there are a couple of options for the user to define:
selectionDialog - defines if the dialog box is displayed (default true).
countToday - sets day option if the dialog has not been set (true is today, false is yesterday - default is true).
Run the script run and a dialog box will show how many tasks you have completed for your chosen day. By clicking 'ok' the script will tell HabitRPG to trigger the '+' for the relevant habit.
Two additional scripts have been added OmniRPG Today and OmniRPG Yesterday these are predefined scripts allow for quick triggering the today and yesterday options.
Difficulty levels (low, medium and high) - By default any OmniFocus task without a special note or @context will show up as a defauly low difficulty task. To mark a task either add your prefered difficulty level in ALL CAPS to the note: LOW, MEDIUM, HIGH or use a context called @Low, @Medium or @High and the script will recoginse them!
For easy access the script menu item (accessible within Script Editor Preferences) can be used and OmniRPG.scpt can be added to the 'User Scripts Folder'.
Hope that you can find a use for it!
Matt
P.S - I'd love some feedback, open to feature requests too!