Append Notes from AppleScript

I utilise the notes field as sort of a logbook of things done on a task, I have been using the Ruby gem rb-appscript to make changes to the notes field dependent on certain criteria. I am wondering if it’s possible to append to the notes field whilst retaining custom formatting in there? When i do it currently it changes the text formatting back to the default.


I don’t use rb-appscript, so I can give you an example that would work out of the box in that environment, but here’s how you’d do it in AppleScript:

tell application "OmniFocus"
    tell note of last inbox task of default document
	    if it does not end with return then
		    make new paragraph at end with data (return as text)
	    end if
	    make new paragraph at end with data "text to append"
    end tell
end tell

Hey Jim,

Apologies I didn’t see a notification about this coming in.

With the above example you’ve given, will that continue to use the same formatting as the text that already exists in the comments section? Or will it overwrite the formatting or the whole thing?



It will append the new text using the default note style, and leave the formatting of the rest of the note in tact.