Scripting - EventListener on changing of ActiveDocument
Hi guys,
I'm enjoying more and more scripting and managed to create a few scripts already that help improve my productivity. Right now, I need your insight to figure out if something is possible within a script. If yes, then how would you tackle the problem? So far, I haven't succeeded to make it happen.
Note that I'm just trying to make parts of the scripts better, let's say more "automatic".
- Is it possible to get something done automatically when we change the Active Document when a script is already "active" (ie changing tabs, opening a new file)?
What are we talking about here :
- I've got a script running via a palette (a window always open then, that only closes when I want to)
- I've got an EditText in this palette that gathers the name of the Active Document, among other things.
- When I run the script, it gets automatically the name of the ActiveDocument
- Since it's a palette, I can swap to another document/ tab (or open a new file), without losing the script.
- But on the palette, the content of the EditText stays the same until I hit a button named "Refresh" that runs a function which gathers the name of the new Active Document. It works fine, but it's obviously manual
I would like to update the content of this damn EditText upon the opening/ change of documents.
I've tried things like ActiveDocument.addEventListener("onChange", … with no avail.
And I've found this page on the forum that doesn't give me much hope… but it's 7yo so maybe…
Where is there a list of InDesign Event types?
Any thoughts ?
Thanks for your time and help
