/ Id-Extras Forum / AfterOpen Script / Reply To: AfterOpen Script
March 23, 2021 at 8:50 pm
#6325
Participant
This seems to work for me, when an existing document is opened. It shows the number of pages in the document. I changed the name of the #targetengine, though, to make it persistent.
Code:
#targetengine MyOpenEvent
app.addEventListener(‘afterOpen’, myOpenFunction);
function myOpenFunction(myEvent){
if(myEvent.target instanceof Document){
alert(myEvent.target.pages.length);
}
}
Does that help?
Ariel