Recently I found that BetterTouchTool could place some widgets on MacBook Pro’s new Touchbar, like a app switcher. Due to its AppleScript capability, it can do many many different things. Today I wrote a Apple Script that could get number of flagged tasks in OmniFocus and let BTT display it on the Touchbar. It is quite cool.
I tested the method with OmniFocus 2.8.3 and BetterTouchTool 2.071.
Here is how to do it
- under the “TouchBar” tab, add a new Widget,
- from the “Select Widget” dropdown menu,
- select “Run Apple Script and Show Return Value”,
- open “Advanced Configuration”
- set the name of the widget to whatever you like
Copy the code below into the box
tell application "OmniFocus"
tell the default document
set flaggedCount to count (flattened tasks whose completed is false and flagged is true)
return (flaggedCount as string) & " tasks now!"
click “Run Script” to check if you get the expected output,
save and now you have it!