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"
}*/
(() => {
var action = new PlugIn.Action(async function(selection, sender){
var preferenceURL = "omnifocus:///change-preference?OSTextAttachmentURLifyEnabled="
var optionsMenu = new Form.Field.Option(
"prefValue",
null,
[0,1],
["Off","On"],
1
)
var inputForm = new Form()
inputForm.addField(optionsMenu)
var formPrompt = "Select the default behavior for detecting URLs in notes:"
var buttonTitle = "Continue"
var formObject = await inputForm.show(formPrompt,buttonTitle)
var prefValue = formObject.values["prefValue"]
URL.fromString(preferenceURL + String(prefValue)).open()
});
action.validate = function(selection, sender){
return true
};
return action;
})();