Jump to content

Recommended Posts

Build Status Coverage Status

ALFRED TODOIST WORKFLOW

Add and search Todoist tasks straight from Alfred. It uses Todoist v8 REST API.

Getting started

  • For this workflow to work you need version 3.x of Alfred and a powerpack licence.
  • Node.js

Installation

Download and import workflow.

Configuration

Name Notation Explanation
token ^[0-9a-fA-F]{40}$ (default empty) The todoist API token.
language en, da, pl, zh, ko, de, pt, ja, it, fr, sv, ru, es, nl(default en) The language for natural language date processing (by todoist) and to calculate time to complete a task.
cache_timeout A positive number (default 3600, an hour) The time (in seconds) until the cache is refreshed (until that time todoist information is stored locally to make things a little faster)
anonymous_statistics true or false (default true) Doesn't do much at the moment but I intent to use it to track installs

todo:setting token {api token}
Example: todo:setting token 2d2e2a334c5f36e7a7c43b46e

todo:setting language {language}
Example: todo:setting language nl

todo:setting cache_timeout {time in seconds}
Example: todo:setting cache_timeout 13

todo:setting anonymous_statistics {true or false}
Example: todo:setting anonymous_statistics false

Usage

Name Notation Explanation
task Any text except , The task title.
date A date string See the Todoist documentation for supported date formats.
project Either #personal or #[next actions] Use either the hashtag notation or bracket notation if the project name has spaces in it. The project name is case insensitive.
label @label Label names can't contain any whitespace characters. Labels are case insensitive.
priority Either p2 or !!2 A value between 1 (urgent) and 4 (normal)

Search for tasks

todos {query}

Query

Any search query one character or longer. Uses fuzzy search to find the tasks.

Example: todos car => returns (because of fuzzy search):

  • Rent car
  • New cat recipe's
  • Cut Gras tomorrow

Create task

todo {task}, {date}

Example: todo Get things done, tomorrow @ 9
Example: todo Build tree house #home !!2 @15min, tomorrow @ 9

Changelog

View CHANGELOG.md

Contributing

Instructions

- Fork and clone the repo
- Install dependacies
- Symlink to project workflow folder

  git clone https://github.com/YOUR-USERNAME/alfred-worflow-todoist
  npm install
  npm run setup:dev

Build

Create a new build with

npm run build

Run tests

Run Jest test suite with:

npm run test npm run test:prod

Or run a watcher with

npm run test:watch

Commits

For commits I follow the angular commit guidelines and use semantic release to automate builds, semver version updates and changelog creation. The way to make sure this all works is to run:

npm run commit

Which guides you through the motions

Code of conduct

code-of-conduct.md

License

License MIT © Martien Oranje

 

Edited by Martien Oranje
Update

Share this post


Link to post

Looks handy. The GitHub URL is a 404, unfortunately.

 

A couple of suggestions for possible improvement:
 
It'd be better if you could move the configuration into a separate file. There are standard locations for such files. The reason is that any update to the workflow will overwrite the user's config.

 

The simplest way would perhaps be to add another action that creates the config file if necessary, and then opens it in the user's default editor (open /path/to/config.sh). You could use export TOKEN=xxx in the config file and then source it from your other scripts.
 
⌘+T isn't a great default shortcut: it's what pretty much every application that has tabs uses to create a new one.

Edited by deanishe

Share this post


Link to post

Looks handy. The GitHub URL is a 404, unfortunately.

 

A couple of suggestions for possible improvement:

 

It'd be better if you could move the configuration into a separate file. There are standard locations for such files. The reason is that any update to the workflow will overwrite the user's config.

 

The simplest way would perhaps be to add another action that creates the config file if necessary, and then opens it in the user's default editor (open /path/to/config.sh). You could use export TOKEN=xxx in the config file and then source it from your other scripts.

 

⌘+T isn't a great default shortcut: it's what pretty much every application that has tabs uses to create a new one.

 

Hi, thanks for your feedback!

 

The config options are not ideal, I was looking for a way to make the usage a little friendlier. Good tip on the opening command too. I'm aware of ⌘+T not being ideal (I have added iTerm to the list of related apps that shouldn't have focus), can you recommend something a little more idiomatic to alfred?

 

Will update when I have some more time to invest. I'll fix the github url straight away, nice catch.

 

Martien

Share this post


Link to post

No idea regarding the hotkey. I guess it doesn't really matter, as Alfred strips any hotkeys defined in the workflow on installation (it tries to preserve user-set hotkeys across updates).

Share this post


Link to post
ObjC.import('stdlib');
var dataDir = $.getenv('alfred_workflow_data');

 

Edited by deanishe
Put code in code box

Share this post


Link to post

Did anyone else experience any problems with adding tasks?

 

When I try Alfred says "Task was added to your inbox" but nothing happens. I have added the token which I got from Todoist settings -> account -> API token. 

 

Any ideas of what the issue could be? I am using the free version of the Todoist together with Alfred3

 

Cheers

Share this post


Link to post

I'm facing the exact same issue.

 

I've correctly registred the token, and when I add a task it says "Task was added to your inbox", but nothing appears in my todoist :(

 

NodeJS is also correctly installed through brew.

Share this post


Link to post

Hi guys,

 

I can't reproduce the problem. Adding tasks doesn't require node.js. And since the first release not much has changed to the logic of adding a task, though I can't be a 100% sure a bug hasn't found it's way in. Can you shoot me some more info on:

- Your mac OS versions

- Alfred versions

 

Please check that there are no spaces in the token. Also check 

~/Library/Application Support/Alfred 3/Workflow Data/com.alfred-workflow-todoist

for a file named settings.json (private information!) for anything that looks off there (no token, invalid json formatting, nothing at all). Let me know what you find.

 

Martien

Edited by moranje

Share this post


Link to post

Hi Martien,

 

Thanks for replying :). I am using OSX version 10.11.6 and Alfred v3.0.2.

 

I have tried to reinstall the workflow without any progress. I have not installed the json so I am lacking the folder you refer to, is that correct? I have copied the token and made sure it didn't have any whitespace but it didn't work still.

 

Thanks for the help!

 

/Niklas

Share this post


Link to post

I just installed the json because when I went into the debugger in Alfred I could see that it was complaining. Now Alfred said I successfully installed it but the folder you are referring to in the Library is still missing :/ 

Share this post


Link to post

I'm having the same problem I also don't see folder com.alfred-workflow-todoist in Workflow Data, though I see the settings for my other Alfred workflows :(

Share this post


Link to post

I'm experiencing the same problem. The folder doesn't exist inside Workflow Data.

/Application Support/Alfred 3/Workflow Data/com.alfred-workflow-todoist/settings.json: No such file or directory

I was able to fix it by creating the folder "com.alfred-workflow-todoist" manually and then when I opened the folder the file seemed to appear by itself or possibly after I attempted to add a todo item. Then I opened in text editor and it was missing the token key. Pasted it in there and saved and now it works and is able to add tasks.

 

It seems that there is likely a problem in the configuration of the token whereas I have reinstalled the workflow, the first time I applied the token to the script in the workflow editor and the second time I applied it through the t:token command and it seems neither of these actually apply the token to the settings file. I would assume there is a permission error preventing it from applying these changes.

Edited by etaming

Share this post


Link to post

Updated to version 3.0.0. The significant changes are:

  • You are now able to add a task to an existing project

Ex:  todo Buy milk, tomorrow at 6pm, groceries (groceries being the project)

  • You are now able to add labels to your tasks

Ex: todo Buy milk @diary @white_stuff @food

  • The API changed to accommodate labels and projects, whereas it used to be that you would assign a priority like this:

Ex: todo Buy milk, tomorrow at 6pm, 3

 

You can now achieve the same thing as follows:

 

Ex: todo Buy milk !!3, tomorrow at 6pm, or for that matter like this:  todo Buy milk, tomorrow at 6pm !!3

 

Cheers,

 

Martien

Share this post


Link to post

New version 3.1.0:

[FEATURE] `todos + {query}` (todo search) command added, now you can fuzzy search your tasks.
[FEATURE] caching! Cache is refreshed on hitting `t`. Everything should run a little faster now.
[CHANGE] running `todos` without a query will list your todos (this feature used to be under `todo`)

Share this post


Link to post
Hi Guys

 

I am a relative newbie to Alfred 3 and to Workflows in general.

 

Try as I might however I have simply been unable to get the Todoist workflow to work !!

 

I have obtained my API Token from Todoist , downloaded and installed the latest workflow version.

 

I have then navigated to the workflow in Alfreds “Workflow” section and opened up the initial “t” script filter.

 

I have noted the location on the 4th line where the api token needs to be inserted and have pasted the token into place ensuring no white spaces or gaps.

 

On each attempt I have made to use the workflow I keep receiving the following :

 

Failure

 

Error: Invalid argument value,”command_type”,”item_add”,”error_code”:20,”http_code”:400

 

I have also looked into 

 

~ Library/Application support/Alfred 3/Workflow Data/com.alfred-workflow-todoist

 

and can confirm the existence of the file “settings.json”

 

This file contains the api token details.

 

I would greatly appreciate advise and guidance as to how I may be able to get this workflow configured in order that I can use it.

 

Kind Regards

Paul

Share this post


Link to post

 

Hi Guys
 
I am a relative newbie to Alfred 3 and to Workflows in general.
 
Try as I might however I have simply been unable to get the Todoist workflow to work !!
 
I have obtained my API Token from Todoist , downloaded and installed the latest workflow version.
 
I have then navigated to the workflow in Alfreds “Workflow” section and opened up the initial “t” script filter.
 
I have noted the location on the 4th line where the api token needs to be inserted and have pasted the token into place ensuring no white spaces or gaps.
 
On each attempt I have made to use the workflow I keep receiving the following :
 
Failure
 
Error: Invalid argument value,”command_type”,”item_add”,”error_code”:20,”http_code”:400
 
I have also looked into 
 
~ Library/Application support/Alfred 3/Workflow Data/com.alfred-workflow-todoist
 
and can confirm the existence of the file “settings.json”
 
This file contains the api token details.
 
I would greatly appreciate advise and guidance as to how I may be able to get this workflow configured in order that I can use it.
 
Kind Regards
Paul

 

 

 

I do have the same problem and I cannot find any solution to it. Any help? Many Thanks

 

 

Hi guys,

 

Make sure you have downloaded v3.0.2 and redownload it if you have changed any of the scripts, that's not the intended way.

 

In the Alfred bar, type the following and replace the token with your own. 

t:token 238948934acde892edc989

You should be all set. If you need more instructions, check out the GitHub page.

 

Let me know if you need any more help.

 

Martien

Share this post


Link to post

Hi Martien

 

Thank you for your response.

 

I have removed my old installation , re-downloaded from the Git Hub link provided and re-installed.

 

I note however that the version number is not 3.0.2 but is in fact 3.1.2 in case there is any significance here ??!!

 

I navigated to the "Alfred Bar" where I am able to click on the "Configure workflow and variables" dialogue button and inserted my token details as per the image in the link below ( I have of course pixelated my personal token number)

 

The workflow still returns failures so clearly some issue remains - what am I doing wrong ?

 

Dropbox Image

 

Kind Regards
Paul

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×