Well, you can just set an afterOpen event and catch that and use it to set an afterActivate listener.
I'm curious what you're going to do with an afterActivate listener, though -- what's it good for?
Well, each document is assiged to something called a campaign. So there could be more than one campaign open at once in indesign by a bunch of documents. So I wanted to be able to dynamically update some variables when a user activates a document that is different campaign than the previous document they had active.
"update some variables"? You mean, like global variables in a persistent script?
I would suggest that you would be much better architecting your script differently.
Perhaps having a global Object that your script looks up the active document in, instead of using a global variable.
Or putting your data inside the document with .insertLabel().
Usually global variables are a bad idea. And in this case, it sounds like you're trying to mimic local scoping by using event handlers, and that sounds somewhat scary to me.
Haha, you just perfectly described the transition of how I am writing my scripts. I began by using a bunch of global variables when I started. I am slowly transition to keeping data in the document with insertLabel(), just so much code was written to be handled using global variables it is a pain! But, it will probably be better in the long run, so I will have at it. Thanks for the pointers! I'm always trying to learn.