1. Is it possible to write event listeners for this?
2. Would it be possible to include this in the same script as the rest of the Script UI interface code (that is, I'd prefer avoiding a separate file in the startup folder).
1. Yes. The selection events work well in my experience.
2. Yes, you don't have to add them at startup. You can do something like:
before you open your window. Remove the listener in the onClose event of the window. I think you'll have to have some error trapping in the selectionChangedFunction to deal with app.selection erroring after a document close or during a revert.
3. See this thread for an extension that lets you see events as they're happening.
Europe, Middle East and Africa