Created
April 5, 2011 02:50
-
-
Save joe-pindell/902936 to your computer and use it in GitHub Desktop.
Tag with Done Alternative with Date - TaskPaper Applescript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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