View Single Post
Quote:
Originally Posted by RobTrew View Post
You can use the not operator to flip the current state of the note expanded property of a content panel tree node.
... and you can also apply the change to sub-tasks and their descendants:

Code:
tell application id "OFOC"
	tell default document
		tell content of front document window
			set lstTaskNode to selected trees where class of value is task or class of value is inbox task
			repeat with oTaskNode in lstTaskNode
				tell oTaskNode
					set blnNewState to (not note expanded)
					
					-- toggle the selected node
					set note expanded to blnNewState
					
					-- and reset the notes of all descendant tasks to the same new state
					set note expanded of descendant trees to blnNewState
				end tell
			end repeat
		end tell
	end tell
end tell