Plug-In: Reveal and Select All Tasks

Requires OmniFocus 4

This plug-in will reveal and select all tasks in the content tree of the front OmniFocus window.

Return to: OmniFocus Plug-In Collection

Reveal and Select All Tasks
   

/*{ "type": "action", "targets": ["omnifocus"], "author": "Otto Automator", "identifier": "com.omni-automation.of-reveal-select-all-tasks", "version": "1.0", "description": "This plug-in will reveal and select all tasks in the content tree of the front OmniFocus window.", "label": "Reveal and Select All Tasks", "shortLabel": "Reveal & Select Tasks", "paletteLabel": "Reveal & Select Tasks", "image": "circle.inset.filled" }*/ (() => { const action = new PlugIn.Action(async function(selection, sender){ try { tree = document.windows[0].content tree.select([]) tree.rootNode.apply(node => { if(node.object instanceof Task){ tree.reveal([node]) tree.select([node], true) } }) } catch(err){ if(!err.causedByUserCancelling){ console.error(err.name, err.message) new Alert(err.name, err.message).show() } } }); action.validate = function(selection, sender){ // selection options: tasks, projects, folders, tags, databaseObjects, allObjects return true }; return action; })();