Created
March 3, 2011 04:03
-
-
Save monzou/852310 to your computer and use it in GitHub Desktop.
Things Script (schdule review tasks)
This file contains hidden or 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
script TermFactory | |
on create(numericValue, unit) | |
script Term | |
property _numericValue : numericValue | |
property _unit : unit | |
to displayName() | |
(my _numericValue as text) & my _unit | |
end displayName | |
to calculateDays() | |
if my _unit = "D" then | |
return my _numericValue | |
else if my _unit = "W" then | |
return (my _numericValue) * 7 | |
else if my _unit = "M" then | |
return (my _numericValue) * 30 | |
else | |
return (my _numericValue) * 365 | |
end if | |
end calculateDays | |
end script | |
end create | |
end script | |
on create_term(numericValue, unit) | |
create(numericValue, unit) of TermFactory | |
end create_term | |
on run | |
(* インターバル/追加対象プロジェクトの設定 *) | |
set terms to {create_term(1, "W"), create_term(2, "W"), create_term(1, "M"), create_term(3, "M")} | |
set projectName to "STUDY" | |
set baseTaskName to text returned of (display dialog "taskName" default answer "") | |
set offsetDays to text returned of (display dialog "offsetDays" default answer 0) | |
set baseTagNames to text returned of (display dialog "tags" default answer "") | |
repeat with t in terms | |
set taskName to (baseTaskName & " (" & displayName() of t & ")") | |
set tagNames to (baseTagNames & ", High, Study") | |
tell application "Things" | |
tell project projectName | |
set todo to make new to do with properties {name:taskName, due date:(current date) + (offsetDays + (calculateDays() of t)) * days, tag names:tagNames} | |
end tell | |
end tell | |
end repeat | |
end run |
タグを選択出来るようにした。★★★ タグも付けるように。
デフォルトのタグを High と Study に変えた。
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
オフセット日数を設定出来るようにした。