Advertisement
n8henrie

Make a List of Numbered Tasks in OmniFocus

Sep 11th, 2012
590
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. on run {}
  2. set counter to 0
  3. 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.”)
  4. try
  5. 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
  6. on error
  7. display dialog “Whups, I don’t think that worked.  Try an integer next time.”
  8. return
  9. end try
  10. set taskNote to text returned of (display dialogIf you’d like the task to have a note, enter it below.” default answer “”) as string
  11. tell application “OmniFocus”
  12. launch
  13. tell document 1
  14. repeat repeatTimes times
  15. set counter to counter + 1
  16. 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
  17. set newTask to make new inbox task with properties {name:taskName, note:taskNote}
  18. end repeat
  19. end tell
  20. end tell
  21. end run
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement