Page 1 of 1

[javascript] find current active document

Posted: Thu Aug 01, 2024 5:51 pm
by Mathew
The app.activeDocs() method returns a list of active documents, but is there a way for a function to know which of them is currently in front? The only way I've found so far is to pass this to the function when calling it. Is there a property or flag somewhere that gives it?

Re: [javascript] find current active document  SOLVED

Posted: Fri Aug 02, 2024 6:40 pm
by Roman - Tracker Supp
Hi Mathew,
To get the foreground document when it cannot be referenced as this, you can use the app.doc property.

Re: [javascript] find current active document

Posted: Fri Aug 02, 2024 9:42 pm
by Mathew
Thank you, Roman! I did not know that property of app existed.

[javascript] find current active document

Posted: Fri Aug 02, 2024 10:12 pm
by Daniel - PDF-XChange
:)

Re: [javascript] find current active document

Posted: Fri Aug 02, 2024 11:12 pm
by Roman - Tracker Supp
app.doc is an undocumented property, however Adobe Acrobat implements it as well.