on open names ...

I’ve rewritten the “Browser” example (in AppleScript Studio examples) to display an XML file rather than a file structure… All was going well until I tried to switch from a hard coded path to an open handler.

Here is the code I added:

on open names
	display dialog "on opened!"
	set theTree to (parse XML (read file (names as string)))
	my processXML("/", XML contents of theTree)
	set path separator of browser "browser" of window "main" to "/"
	tell browser "browser" of window "main" to update
end open

I don’t even get the dialog… And the exact same code works in the “on launched” handler.

Am I doing something stupid? Do I have to change anything to let the app know that it now has an open handler?

Thanks for any help…