URL title in task.note

Setting the value of “link” attribute seems to work here:

newTask.note.style.attributes['link'].value = url

For example, changing title and URL of note property of the first selected task:

(() => {
    'use strict';

    // main :: IO ()
    const main = () => {
        const
            appOF = Application('OmniFocus'),
            win = appOF.defaultDocument.documentWindows[0],
            seln = win.content.selectedTrees()[0].value();

        const setTaskNoteAndLink = oTask => strTitle => strURL => {
            // Sets "link" attribute and note property
            // of a given task.
            return (
                oTask.note = strTitle,
                oTask.note.style.attributes["link"].value = strURL,
                oTask
            )
        };

        return setTaskNoteAndLink(seln)(
            'OmniGroup Website'
        )('https://www.omnigroup.com/omnifocus/ios/')
    };
    // MAIN ----------------------------------------------------------------
    return main();
})();
2 Likes