Created
March 17, 2013 16:41
-
-
Save n8henrie/5182357 to your computer and use it in GitHub Desktop.
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
on run {} | |
set counter to 0 | |
set theTask to text returned of (display dialog “This script will duplicate a task a given number of times and number the tasks accordingly.” default answer “Please enter the name of the task.”) | |
try | |
set repeatTimes to text returned of (display dialog “How many total times do you need to do this task?” default answer “Please enter a number with no text and no punctuation.”) as integer | |
on error | |
display dialog “Whups, I don’t think that worked. Try an integer next time.” | |
return | |
end try | |
set taskNote to text returned of (display dialog “If you’d like the task to have a note, enter it below.” default answer “”) as string | |
tell application “OmniFocus” | |
launch | |
tell document 1 | |
repeat repeatTimes times | |
set counter to counter + 1 | |
set taskName to {(theTask as string) & ” ” & (counter as string)} –Probably could add ” / ” & repeatTimes or something like that to show out of how many times total | |
set newTask to make new inbox task with properties {name:taskName, note:taskNote} | |
end repeat | |
end tell | |
end tell | |
end run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment