Plug-In: Open Note in BBEdit

Opens the text content of the note of the selected task or project as a markdown document in the BBEdit application from Bare Bones software.

NOTE: The name of the task/project is the name fo the file.

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 BBEdit
  

/*{ "type": "action", "targets": ["omnifocus"], "author": "Otto Automator", "identifier": "com.omni-automation.of.open-note-in-bbedit", "version": "1.0", "description": "Opens the text content of the note of the selected task or project as a markdown document in the BBEdit application from Bare Bones software. NOTE: The name of the task/project is the name fo the file.\n<https://www.barebones.com/products/bbedit>", "label": "Open Note in BBEdit", "shortLabel": "Open Note in BBEdit", "paletteLabel": "Open Note in BBEdit", "image": "gearshape" }*/ (() => { const action = new PlugIn.Action(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."} } encodedItemName = encodeURIComponent(item.name) encodedString = encodeURIComponent(noteText) BBEditURLStr = `x-bbedit://new-document/?language=md&name=${encodedItemName}.md&text=` + encodedString URL.fromString(BBEditURLStr).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; })();