Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

Guide ,
Jun 16, 2025 Jun 16, 2025

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

TOPICS
Bug , Feature request , How to , Scripting
102
Translate
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
Community Expert ,
Jun 16, 2025 Jun 16, 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

Translate
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
Community Expert ,
Jun 16, 2025 Jun 16, 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

Translate
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
Guide ,
Jun 17, 2025 Jun 17, 2025
LATEST

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