Execute macro upon page change

I need a way to execute a macro in my main GMS file whenever a PageChange or PageActivate event occurs in any open CDR file. Is this possible?

I see that there are PageChange and PageActivate events in the ThisDocument module of the currently active document, but this limited scope won't be helpful as I need the event to be triggered for any document. Any help is appreciated.