Skip to main content
Inspiring
July 13, 2022
Answered

Scripting to an active InDesign extension?

  • July 13, 2022
  • 2 replies
  • 679 views

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.

 

This topic has been closed for replies.
Correct answer brian_p_dts

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. 

2 replies

Inspiring
July 15, 2022

Thank you both for your insight. I am in the process of contacting the developer. 

I can see that plug-in is written in javascript but its hard to follow. Obviously, I dont want to be tinkering around with a working extension without knowing what I am look at lol.

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.

 

 

Peter Kahrel
Community Expert
Community Expert
July 15, 2022

If you can see that the plug-in was written in javascript, is it really a plug-in? Is it not a JavaScript?

Inspiring
July 15, 2022

well, true. its a adobe CEP extension written in JAVA script

brian_p_dts
Community Expert
brian_p_dtsCommunity ExpertCorrect answer
Community Expert
July 13, 2022

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. 

Inspiring
July 14, 2022

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.