Skip to main content
T882200
Participant
April 2, 2023
Question

Can I add a function to my script so that its window will always open in the center of the screen

  • April 2, 2023
  • 1 reply
  • 244 views

I am writing a script in InDesign that generates a window with user input fields, but I want the script window to always appear in the center of the screen, regardless of the user's screen resolution or monitor size. How can I achieve this? Are there any built-in functions in InDesign Scripting API (in javascript) that I can use? Or will I need to write a custom script to calculate the center of the screen and position the window accordingly? Any advice would be appreciated. Thank you!

This topic has been closed for replies.

1 reply

Kasyan Servetsky
Legend
April 2, 2023

Instead of the InDesign's built-in Dialog class which, in my opinion, has quite limited posibilities, I recommend you to build your dialog box using Window in ScriptUI. It has the center method.