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.
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.
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}`
}
})();