Basically you should keep track of document id's either by
- allowing user to explicitly select documents you manage
- store ids of open documents (see Generator.getOpenDocumentIDs()) at the time of starting your jsx
- keep track of new documents from the delta having added=true
Then ignore all events from documents created during your jsx
I'm sorry I'm not sure I follow. I'm working with one document, imageChanged event dispatches when active document changes and I want to ignore active document changes from my jsx so imageChanged wouldn't go in infinite loop
Not sure either anymore. My understanding was that your JSX is changing/creating docs that causes issue for your Generator plugin that would think user is doing something and would need to fire the JSX again. Because of that my suggestion was that you need logic to detect if doc changes are caused by your jsx or by the user.
But I don't understand why JSX needs to ignore active doc changes since it's the cause of the changes, right? While jsx is running, user can't change anything.