View Single Post
Well, you've actually got exactly the statement you need to do what you want. The tricky part is getting your hands on the selected item!

Here's a sample script that will append a string to the notes field of the selected items. Note that it does not drill down into contained items.

Code:
tell application "OmniFocus"
	tell front document
		tell (first document window whose index is 1)
			set theSelectedItems to selected trees of content
		end tell
		repeat with i from 1 to count of theSelectedItems
			set selectedItem to value of item i of theSelectedItems
			set theName to name of selectedItem
			set theNote to note of selectedItem
			set theNote to theNote & "
This is a note inserted in " & theName
			set note of selectedItem to theNote
		end repeat
	end tell
end tell