I was wondering if anyone knew why Adobe choose to open a document "hidden" in the event "afterOpen"? Or was it to handle different events when opening several documents at once? In that case none of them would be the activeDocument. The problem is you have to maintain 2 sets of scripts: One for user actuated (Doc = app.activeDocument) and a second for the eventListener (Doc = event.parent).
Am I correct in my assumption or is it possible for the script to determine if it was executed manualy or by eventListener?