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

Assistance Needed: Retrieving Server Information During InDesign Script Execution

Community Beginner ,
Nov 15, 2023 Nov 15, 2023

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.

TOPICS
Scripting
242
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 ,
Mar 15, 2024 Mar 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.

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
Explorer ,
Mar 15, 2024 Mar 15, 2024
LATEST

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

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

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