Skip to main content
Participant
November 15, 2023
Question

Assistance Needed: Retrieving Server Information During InDesign Script Execution

  • November 15, 2023
  • 2 replies
  • 298 views

Dear Team,

Hi Team

I am currently seeking assistance in obtaining server-related information.

Is there a method available to retrieve the running PORT number during the execution of an InDesign Script file?

In my specific scenario, the Load Balancer dynamically determines the port number at runtime, which could be 12345, 12346, or 12347. Consequently, I am eager to ascertain the specific port number on which our script file is currently executing.

Your support in this matter is greatly appreciated.

Thank you in advance.

This topic has been closed for replies.

2 replies

sneha30692552dvkj
Inspiring
March 15, 2024

Hi @Bhaskar33442702dimp you can use the system object in ExtendScript like

var runningPort = system.callSystem('netstat -an | find "LISTEN" | find ":12345"');

Community Expert
March 15, 2024

I don't think that a script can directly get a port number as it only automates tasks in InDesign application. 

 

I don't know of any workarounds specifically but a few thoughts come to mind.

 

Maybe you need a server-side component that determines the port number and that can relay info back to the script somehow, maybe with sockets or HTTP requests.

Might be a web service that runs on the server the script querys it and retrieves the port number, maybe that would work dynamically.

 

Maybe the load balancer sets an environment variable with the port number, maybe a script could access this.

 

I'm only guessing from my very limited experience.