Plug-In: Set Preference for URL Detection
Set the hidden preference for automatically detecting URLs in note text.
Return to: OmniFocus Plug-In Collection
Set Preference for URL Detection
/*{
"type": "action",
"targets": ["omnifocus"],
"author": "Otto Automator",
"identifier": "com.omni-automation.of.detect-url-preference",
"version": "1.0",
"description": "Set the hidden preference for automatically detecting URLs in note text.",
"label": "Preference · URL Detection",
"shortLabel": "URL Detection Pref",
"paletteLabel": "URL Detection Pref",
"image": "gearshape"
}*/
(() => {
const action = new PlugIn.Action(async function(selection, sender){
preferenceURL = "omnifocus:///change-preference?OSTextAttachmentURLifyEnabled="
optionsMenu = new Form.Field.Option(
"prefValue",
null,
[0,1],
["Off","On"],
1
)
inputForm = new Form()
inputForm.addField(optionsMenu)
formPrompt = "Select the default behavior for detecting URLs in notes:"
buttonTitle = "Continue"
formObject = await inputForm.show(formPrompt, buttonTitle)
prefValue = formObject.values["prefValue"]
URL.fromString(preferenceURL + String(prefValue)).open()
});
action.validate = function(selection, sender){
return true
};
return action;
})();