×

OmniFocus: Export Selected Projects as TaskPaper

The actions of the following shortcut can be used to return the currently selected projects as TaskPaper data (text). These actions can be copied and pasted into your shortcut.

DOWNLOAD SHORTCUT

This template works with Apple Notes, Apple Mail, Drafts, Bear, Craft, and other 3rd-party applications with integrated Shortcuts support that accept text as input.

 1  “Open App” action • Make OmniFocus the active application.

 2  “Omni Automation Script” action • An asynchronous JavaScript function that returns the data of the selected projects in TaskPaper format.

Export Selected Projects as TaskPaper data

 3  FileWrapper • Create a FileWrapper instance containing the data of the selected projects in TaskPaper format.

 4  Return TaskPaper Text • Return the text contents of the created FileWrapper.

Export Selected Projects as TaskPaper Data (text)


(async () => { try { if(!selection.projects.length > 0){ throw { name: "Selection Issue", message: "Please select one or more projects." } } var typeID = "com.omnigroup.omnifocus2.export-filetype.plain-text" var baseName = "TaskPaper-Export" var wrapper = await document.makeFileWrapper(baseName, typeID) var wrapperContents = wrapper.contents.toString() return wrapperContents } catch(err){ if(!err.message.includes("cancelled")){ await new Alert(err.name, err.message).show() } throw `${err.name}\n${err.message}` } })();