Scripting to an active InDesign extension?

Explorer ,
Jul 13, 2022 Jul 13, 2022

Copy link to clipboard

Copied

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.

 

TOPICS
Scripting

Views

102

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Adobe Community Professional , Jul 13, 2022 Jul 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. 

Likes

Translate

Translate
Adobe Community Professional ,
Jul 13, 2022 Jul 13, 2022

Copy link to clipboard

Copied

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. 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jul 14, 2022 Jul 14, 2022

Copy link to clipboard

Copied

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. 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 15, 2022 Jul 15, 2022

Copy link to clipboard

Copied

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.

 

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Jul 15, 2022 Jul 15, 2022

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 15, 2022 Jul 15, 2022

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Jul 15, 2022 Jul 15, 2022

Copy link to clipboard

Copied

LATEST

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. 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines