Skip to main content
dublove
Legend
Jun 17, 2025 2:04 AM UTC
Question

Can js tell if the InDesign icon on the taskbar is activated (current window)?

Is it possible to determine if the current window is InDesign?
Or does the script fail when InDesign changes to a non-current application?

3 replies

Community Expert
Jun 17, 2025 4:35 AM UTC

What exactly is the end goal here? Let us know what do you want to do, maybe then some ideas could float around

-Manan

Translate
-Manan
dublove
dubloveAuthor
Legend
Jun 17, 2025 10:38 AM UTC

It's using the script given by m1b, opening the image and modifying it in PS.
After saving the image, go back to ID and the image is automatically updated.

What's happening now is that the picture won't update quietly.
You need to trigger the switch manually.

 

Whereas Indesign's default modus operandi (Alt+double-click), which opens the diagram, modifies it, and then saves it, it is capable of automatically updating the links (and occasionally not updating them).

Translate
m1b
Community Expert
Community Expert
Jun 17, 2025 2:25 AM UTC

I'm not an expert on this question, but here are some of my observations, and these are only on MacOS and might be different for Windows:

 

1. A script will run fine when Indesign isn't the frontmost application. I often let a long-running script work away while I'm doing something else in another app.

2. However, certain operations will interfere. eg.

- ScriptUI dialogs sometimes float in front of everything, even when I switch to another app.

- Some operations cause Indesign (actually this is more common with Illustrator) to "demand to be frontmost" and will pause the script until I make indesign frontmost again (and then I can go back).

 

As I said, I suspect these details will be different with Windows because of how active apps and windows are managed.

 

So the short answer is the script will not usually fail when Indesign changes to a non-current application.

- Mark

Translate