Skip to content

Instantly share code, notes, and snippets.

@n8henrie
Created March 17, 2013 16:41
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 n8henrie/5182357 to your computer and use it in GitHub Desktop.
Save n8henrie/5182357 to your computer and use it in GitHub Desktop.
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