Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement