Skip to content

Instantly share code, notes, and snippets.

@monzou
Created March 3, 2011 04:03
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 monzou/852310 to your computer and use it in GitHub Desktop.
Save monzou/852310 to your computer and use it in GitHub Desktop.
Things Script (schdule review tasks)
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
@monzou
Copy link
Author

monzou commented Mar 20, 2011

オフセット日数を設定出来るようにした。

@monzou
Copy link
Author

monzou commented Jun 11, 2011

タグを選択出来るようにした。★★★ タグも付けるように。

@monzou
Copy link
Author

monzou commented Nov 4, 2012

デフォルトのタグを High と Study に変えた。

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