Category: Todoist

Total 2 Posts

Todoist Office Hours: Timeblocking & day theming

I am still relatively new to Todoist but I have quickly adopted it into my daily workflow. As with all tools I use often, I believe it is important to become as proficient as possible in them. As such, I watched the following video with Gabriela Brasil and Chase Warrington.

There are 2 little tips that I learned. The first which I adopted immediately is the difference between “every” and “every!”. If I say:

every week starting wednesday

This task will be due on Wednesday and when I mark it as complete, a new occurrence will be scheduled with a due date of the following Wednesday. If I say:

every! week starting wednesday

This task will be on Wednesday. When I mark it as complete, a new occurrence will be scheduled one week from when I completed it. So, if I mark is as complete on Monday, the next instance will be due 1 week from Monday.

The second tip I have not used yet is this concept of an “uncompletable” task. This is a task that appears but without the circle control to mark it as complete. These tasks are created by starting the task text with an asterisk and a space. For example:

* This task cannot be marked as completed.

AppleScript to Add Task to Todoist

Todoist

In general, using templates or recurring tasks fulfill most use cases for adding routine tasks to Todoist. Occasionally, there are a set of tasks which could use some more complex logic around the text of the task, calculating due dates, etc. On the Mac, I usually turn to AppleScript.

AppleScript

So, we start with a very basic Apple Script function that can be called from within your main script.

on addItem(args)
	
   set defaultArgs to {priority:1, schedule:""}
	
   set args to args & defaultArgs
	
   set content to content of args
	
   set labels to labels of args
	
   set priority to priority of args
	
   set schedule to schedule of args
	
	

   set token to "GET FROM YOUR ACCOUNT"
	
   set myUUID to do shell script "uuidgen"
	
   set tempUUID to do shell script "uuidgen"
	

   set due to "{\"string\":\"" & schedule & "\"}"
   set tdCommand to "[{\"type\": \"item_add\", 
     \"uuid\": \"" & myUUID & "\", 
     \"temp_id\":\"" & tempUUID & "\", 
     \"args\": {
         \"content\": \"" & content & "\", 
         \"due\":" & due & ", 
         \"priority\":" & priority & ", 
         \"labels\":" & labels & "}}]"
	

   set curlCmd to "curl    https://api.todoist.com/sync/v8/sync -d token=" & token & " -d commands='" & tdCommand & "'"
	
	
   do shell script curlCmd

end addItem

This function depends on 2 external programs:

  • curl
  • uuiden

Once we have this function, it can then be used inside of a script, for example:

display dialog "Please enter some text to prefix the task :" 
set entryPrefix to text returned of result

set labelIds to "[1111111111, 1111111112]"

addItem({content:"(" & entryPrefix & ") " & "Task text", priority:2, labels:labelIds})