Skip to content

Instantly share code, notes, and snippets.

@consindo
Created January 12, 2013 02:09
Show Gist options
  • Save consindo/4515683 to your computer and use it in GitHub Desktop.
Save consindo/4515683 to your computer and use it in GitHub Desktop.
Nitro todo.txt generator
textfile = ""
pro = true
if pro
tasks = Task.sort(Task.list("all"))
# Avoids Logic
priorityArray = ["", "(A) ", "(B) ", "(C) "]
i = 0
while i < tasks.length
textfile += priorityArray[tasks[i].priority]
textfile += tasks[i].name
textfile += " due:" + new Date(tasks[i].date).toISOString().substr(0, 10) unless tasks[i].date is ""
textfile += " +" + List.find(tasks[i].list).name + "\n"
i++
else
textfile = "You'll need a Nitro Pro Account to generate todo.txt\nLearn more at <http://nitrotasks.com>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment