Help - AppleScript, walking an outline

Steve Ivy steve at redmonk.net
Fri Jan 4 10:45:01 PST 2002


Firstly, I really appreciate the level of support for AppleScript 
already in OO. However (unless this changed immediately prior to the 
final release of 1.2) there is no way to get the children of an outline 
heading. I need to be able to walk the hierarchy, and get the children 
of a particular node.

I'm not explaining this well, maybe some pseudo-code would help...

tell app OO
	set outText
	for cNode in the children of the root of document 1
		(*top level elements*)
		set outText to outText & "<ul>" & (the title of cNode)
		for ccNode in the children of cNode
			set outText to outText & "<li>" & (the title of ccNode)
		end
	end
end tell

This is a silly example, I know... but I have not been able to make 
something like this work. The thing seems to be that "the children of 
the root of document 1" returns a list of "application 'OmniOutliner'" 
items. Now, I'm no expert in AppleScript, but I'm confused (as is 
probably obvious by now.)

If anyone can decipher what I'm trying to say here, and has a clue as to 
what I can do to solve this, I would be grateful.

--Steve Ivy, outline lover




More information about the OmniOutliner-Users mailing list