Git Product home page Git Product logo

omnifocus-habitica-link's Introduction

Scripts to allow a transfer of tasks from Omnifocus to Habitica.

Installation

git clone https://github.com/SL-LAIDLAW/Omnifocus-Habitica-Link

For the Applescript to work properly, you'll have to create a script in the Script Editor saved as a binary .scpt file in the directory below. This script should have a simple "run script [ directory where you did the git clone]/Task to Habitica.applescript" command so you can use this script from the Omnifocus menu bar.

Another .scpt file should also be made in the omnifocus script folder but this time running the script "Autosort.applescript". In my own setup I have removed the sync button from the Omnifocus toolbar and in its place put the Autosort script as it also syncs and checks for new completed habitica tasks. I have also setup a cron job to run the Autosort script every 30 minutes to avoid having to manually think to check.

~/Library/Application Scripts/com.omnigroup.OmniFocus2/

In the git clone directory make sure to create a file "config.txt" where the first line is your user key and where the second line is your API code. You can get both of these from your Habitica settings page.

How it works

When you flag one or multiple tasks and run the "Task to Habitica" script, a POST request will be made using your API details (taken from the config.txt file in the same repository) with the title of the task and with the Omnifocus task ID as the description.

Later on after having completed the task in Habitica, the Autosort script will be run (by your cronjob or manually) and will get the descriptions of all the completed Habitica tasks, and thus have the Omnifocus task IDs. These taks will be checked off in Omnifocus, and their IDs will be logged in a file in the script directory as they won't be used again, and to avoid progressivly slowing down the script with every new completed Habitica task.

Autosorting

A more recent addition to the script is the ability to sort inbox tasks based on task name. For basic tasks with repetitive syntax you can write rules that'll be run whenever Autosort checks for new Habitica tasks, to automatically classify said tasks into certain projects, as demonstrated below:

-- Insert your own custom rules here:
		-- for example I have ones for automatically populating my shopping list
		-- my example requires GNU sed to be installed : brew install sed

	else if taskName starts with "Buy more" then
		set shorterName to do shell script "echo '" & taskName & "' | gsed 's/buy\\s*more\\s*//gI'"
		set MyProject to project "Shopping" of folder "Home"
		move currentTask to end of tasks of MyProject
		set name of currentTask to shorterName

omnifocus-habitica-link's People

Contributors

seanlaidlaw avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.