Skip to content

Instantly share code, notes, and snippets.

@cdimartino
Forked from puttiz/pomodoroscript.scpt
Created July 24, 2012 04:49
Show Gist options
  • Save cdimartino/3168099 to your computer and use it in GitHub Desktop.
Save cdimartino/3168099 to your computer and use it in GitHub Desktop.
Things integrate with Pomodoro
-- End : Marking to-dos completed
tell application "Things"
tell list "Today"
set toDoToComplete to to do named "$pomodoroName"
set status of toDoToComplete to completed
set tag names of toDoToComplete to "⌘,✔"
end tell
move toDoToComplete to list "Next"
end tell
activate application "ScreenSaverEngine"
-- Interrupt over : Making to-dos canceled
tell application "Things"
tell list "Today"
set toDoToCancel to to do named "$pomodoroName"
set status of toDoToCancel to canceled
set tag names of toDoToCancel to "⌘,✘"
end tell
end tell
-- Start : work fine
tell application "Things"
try
tell list "Today"
try
set editToDo to to do named "$pomodoroName"
on error
set editToDo to to do named "One Session"
set name of editToDo to "$pomodoroName"
end try
end tell
on error
set newToDo to make new to do ¬
with properties {name:"$pomodoroName",due date:current date} ¬
at beginning of list "Today"
set tag names of newToDo to "⌘"
end try
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment