I’m trying to get an AppleScript that would cause any Completed OmniFocus projects with the word ROUTINE in the title to automatically be deleted. What would a script like that look like? I’m sure it is ridiculously simple and hopefully when I see it in front of me I can pick it apart to create new scripts based off of it easily.
Thanks, but even my incredibly novice scripting skills, or lack thereof, can see that the script there has to do with Files in the Finder not projects in OmniFocus. Did I, perhaps, not post in the right forum category?
As a security measure, the project has to be completed, before it gets to be deleted.
set foundList to {}
tell application "OmniFocus"
tell its front document
set prjList to every project of it
repeat with aprj in prjList
considering case
if name of aprj contains "ROUTINE" and completed of aprj is true then
set end of foundList to contents of aprj
end if
end considering
end repeat
repeat with aprj in foundList
delete aprj
end repeat
end tell
end tell
The day this script doesn’t do what is supposed to do, is the day your Omnifocus backup is corrupted.