I am not sure if this is possible or how to make it work but i thought I would put this out there and get some ideas.
Currently running Indesign 2021 - OS Monterey. My company has invested in a new peice of software that has its own InDesign extension. I am curious if I could activate/toggle a button or function in an active extension window via script?
Example: After Indesign "Save" (or Save As) I would like toggle a specific item in the extension window.
Is this doable? I understand about eventListners etc but I am not sure how I would tell the extension what to do?
Thoughts?? Thank you in advance.
Copy link to clipboard
Whether you could do it with scripting depends on whether the extension itself is scriptable. You'd have to check with the extension developer to know. Another option would be to write a script that on an event calls an applescript that works outside of scripting to mimic keystrokes/mouseclicks or other operations on the extension panel.
As Brian says, it all depends on the extension developer. If you're really lucky, they anticipated a need for scripting. If you're only a little lucky, they piggybacked on the Adobe object model for their own convenience and introduced some methods or objects that you can use. I'm working with an extension that adds "acmeProperties" to every page object, an array of numbers related to the underlying database. When I asked for a translation, the first response was "We didn't intend for anyone else to use that." But eventually they provided some documentation.
If the extension introduces items to the Adobe menu, you also might be able to control those menuActions via script. I've had some success at that, but it can be tricky. I wanted to attach a beforeInvoke event listener to one of the extension's submenus, so I wrote a startup script to do that. After a lot of failure, I realized that the extension was creating the menu item at launch, but then destroying it and recreating it whenever it needed refreshing. So I had to test to see if the target of my event listener was still valid and recreate it as needed.
Thank you both for your insight. I am in the process of contacting the developer.
We curent use a start up script in InDesign (that I wrote) that listens for 'Save', 'Save As' which triggers a few background automations and i was hoping to do the same with our new extension. BUT as noted, whether thats possible is up to the developer. I am thinking it could be accomplished within extensions scripting but not certain.
well, true. its a adobe CEP extension written in JAVA script
You can also look at README documentation of the extension if any to see if it mentions scripting capabilities. But yes, don't mess with the extension.