Skip to main content
dublove
Legend
June 17, 2025
Question

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

  • June 17, 2025
  • 2 replies
  • 167 views

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

2 replies

Community Expert
June 17, 2025

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

-Manan

-Manan
dublove
dubloveAuthor
Legend
June 17, 2025

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).

m1b
Community Expert
Community Expert
June 17, 2025

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