Skip to content

Instantly share code, notes, and snippets.

@joe-pindell
Created April 5, 2011 02:50
Show Gist options
  • Save joe-pindell/902936 to your computer and use it in GitHub Desktop.
Save joe-pindell/902936 to your computer and use it in GitHub Desktop.
Tag with Done Alternative with Date - TaskPaper Applescript
tell application "TaskPaper"
set selected_entries to get selected entries
set theDate to (do shell script "date +'%Y-%m-%d'")
-- Iterate over selection to determine if we are adding or removing done tag
set add_done to false
repeat with each in selected_entries
tell each
if not (exists tag named "done") then
set add_done to true
end if
end tell
end repeat
-- Iterate over selection and add or remove done tag as needed
repeat with each in selected_entries
tell each
if add_done and not (exists tag named "done") then
make tag with properties {name:"done(" & theDate & ")"}
if exists tag named "today" then
delete tag named "today"
end if
else if not add_done and (exists tag named "done") then
delete tag named "done"
end if
end tell
end repeat
end tell
@jasonshanks
Copy link

Would love to have the function added to SublimeText PlainTasks to add a tag for the project name when marking done.

I tried:
set projectname to project make tag with properties {name:projectname}

but I just get an error:
Can’t make project into type rich text.
-1700

I'm sure someone more talented at Applescript could format the project name correctly?

Note: I tried to incorporate this script but I ended up down the same rabbit hole: http://www.hogbaysoftware.com/wiki/GetProjectTag

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment