There seems to be a subtlety about the OnWindowOpen event that escapes me. Here's what I did:
File X has two scripts:
1) WindowOpenTrigger, which appends "WindowOpenTrigger" to a field named "stuff".
2) AppendParamToStuff, which gets the ScriptParameter and appends it to stuff.
X has a script trigger for OnWindowOpen; it calls the WindowOpenTrigger script.
File Y has two scripts:
1) OpenX, which is just Open File["X"]
2) SayHelloAndOpenX, which Performs Script "AppendParamToStuff" in X with a parameter "Hello from Y", and then Open File["X"]
I make sure stuff is empty, close both files, open Y, check that X does not appear in the Window menu, and run OpenX. As expected, stuff contains "WindowOpenTrigger".
Same steps, but run SayHelloAndOpenX instead of OpenX. This time, stuff contains "Hello from Y" only. A window for Y has clearly been opened, but without the OnWindowOpen trigger being executed. How can this be?