Skip to content

Instantly share code, notes, and snippets.

@jgallen23
Created March 31, 2010 04:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jgallen23/349954 to your computer and use it in GitHub Desktop.
Save jgallen23/349954 to your computer and use it in GitHub Desktop.
TaskPaper Cycle Tag Script
property cycleTags : {"low", "medium", "high"}
tell application "TaskPaper"
tell front document
set selected to selected entries
repeat with t in selected
if entry type of t is task type then
set tagged to false
set item_count to number of items in cycleTags
repeat with i from 1 to item_count
set tagName to item i of cycleTags
set alreadyTagged to exists tag named tagName of t
if alreadyTagged then
set tagged to true
delete tag named tagName of t
if i is not item_count then
set newTagName to item (i + 1) of cycleTags
tell t to make tag with properties {name:newTagName}
end if
exit repeat
end if
end repeat
if not tagged then
set newTagName to item 1 of cycleTags
tell t to make tag with properties {name:newTagName}
end if
end if
end repeat
end tell
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment