Plug-In: Open Note in Drafts

Opens the text content of the note of the selected task or project in the Drafts application from Agile Tortoise Inc.

Return to: OmniFocus Plug-In Collection

DISCLAIMER: Mention of third-party websites and products is for informational purposes only and constitutes neither an endorsement nor a recommendation. OMNI-AUTOMATION.COM assumes no responsibility with regard to the selection, performance or use of information or products found at third-party websites. OMNI-AUTOMATION.COM provides this only as a convenience to our users. OMNI-AUTOMATION.COM has not tested the information found on these sites and makes no representations regarding its accuracy or reliability. There are risks inherent in the use of any information or products found on the Internet, and OMNI-AUTOMATION.COM assumes no responsibility in this regard. Please understand that a third-party site is independent from OMNI-AUTOMATION.COM and that OMNI-AUTOMATION.COM has no control over the content on that website. Please contact the vendor for additional information.

Open Note in Drafts
  

/*{ "type": "action", "targets": ["omnifocus"], "author": "Otto Automator", "identifier": "com.omni-automation.of.open-note-in-drafts", "version": "1.1", "description": "Opens the text content of the note of the selected task or project in the Drafts application from Agile Tortoise Inc.", "label": "Open Note in Drafts", "shortLabel": "Open Note in Drafts", "paletteLabel": "Open Note in Drafts", "image": "gearshape" }*/ (() => { const action = new PlugIn.Action(async function(selection, sender){ try { if (selection.tasks.length === 1){ var item = selection.tasks[0] } else { var item = selection.projects[0] } noteText = item.note if(!noteText || noteText.length === 0){ throw {"name":"Missing Resource", "message":"The selected item has no note text."} } encodedString = encodeURIComponent(noteText) DraftsURLStr = "drafts5://x-callback-url/create?text=" + encodedString URL.fromString(DraftsURLStr).open() } catch(err){ new Alert(err.name, err.message).show() } }); action.validate = function(selection, sender){ return ( selection.databaseObjects.length === 1 && ( selection.databaseObjects[0] instanceof Project || selection.databaseObjects[0] instanceof Task ) ) }; return action; })();