Since its early days you can also add a script directly to OmniFocus’ toolbar for quick access. OmniFocus is scriptable since its inception and supports AppleScript and JavaScript automation to a nearly insance level of granularity.
#OMNIFOCUS SCRIPT MAC OS#
Question: What is one automation you over-engineered? Share your thoughts in the comments, on Twitter, LinkedIn, or Facebook.OmniGroup has always strived to integrate their applications as deep as possible into Apple’s operating systems, whether on iOS or Mac OS X. Complex automations may create more problems than they solve. Simple automations are easy to debug, update, and reuse to solve new and evolving problems. Look for the simplest solution that could possibly work. When you do decide it’s time to introduce scripting to an automation, do so gradually. Or you could set up bill pay and have the rent check delivered automatically. You could copy and paste the same TaskPaper project every month. But there’s a lot you can do that doesn’t involve writing a line of code. Programmatically, you can do just about anything. Simple automations are easy to debug, update, and reuse. This is still going to be easy to adjust. This script is still using mostly TaskPaper to create the project. TaskPaperText = TaskPaperText.replace("DUE_DATE", due_date) TaskPaperText = TaskPaperText.replace("DEFER_DATE", defer_date) TaskPaperText = TaskPaperText.replace("MONTH_NAME", month_name) Pay MONTH_NAME Rent Write out rent check\n\ Var defer_date = Intl.DateTimeFormat().format(date) + " 6am" Var due_date = Intl.DateTimeFormat().format(date) + " 5pm"ĭate.setDate(date.getDate() - 6) // Go back 6 more days (1 week) Var month_name = Intl.DateTimeFormat('en-us', ).format(date)ĭate.setDate(0) // Go to the first of the previous (this) month Var date = new Date() // Start with todayĭate.setMonth(date.getMonth() + 1) // …of next month So let’s add a touch of scripting to tweak the TaskPaper. And I don’t want to worry about it until the last week of the month. I want it due at 5pm on the last day of this month. I don’t want this project due at midnight on the first of the month. This is the point where I should stop more often than I do.īut there’s a limit to what TaskPaper can express for due dates and defer dates. You could stop right now and have a perfectly valid script to create a Pay Rent project. If you need to edit the project itself, you can easily make changes to the TaskPaper content without worrying about breaking the entire script. The script only sends the TaskPaper to OmniFocus that part isn’t likely to change. Var app = Application.currentApplication() Var TaskPaperURL = "omnifocus:///paste?target=projects&content=" + encodeURIComponent(TaskPaperText) If you want to have it created for you automatically, here’s a JavaScript for Automation (JXA) script that will create the project for you.
Paste that into OmniFocus and it will create your Pay Rent project. You can create most projects with a little TaskPaper: Pay Rent month) Write out rent check
And once you have an automation in place, the second rule of automation kicks in: if it ain’t broke, don’t fix it.) (In my defense, I think I did that before OmniFocus supported TaskPaper. It’s overkill, but I had a hammer and so it looked like a nail. Take, for example, a project to pay the rent: Pay Rent The more complicated a script is, the harder it is to debug and the harder it is to extend. Start with the simplest thing that could possibly work. The first rule of automation is to keep it simple. But I’ve fallen into the same trap into which every automator eventually tumbles: It lets me add my own features to OmniFocus. I’ve been scripting OmniFocus for years now. You can also use it with Shortcuts to create dynamic projects on iOS.
TaskPaper is a great format for copying and pasting tasks and projects between OmniFocus and other apps.