Skip to main content
Participant
August 1, 2022
Answered

InDesign Script Path location

  • August 1, 2022
  • 4 replies
  • 4014 views

Hello,

 

I configured an InDesign Server instance to attend on SOAP, port 12345. When I invoke remotely a script to execute there, specifying the script filename, it gives me an error that the script can not be found. The script is currently in the Scripts folder of InDesign Server.

 + How can I specify the script path to use by InDesign Server when looking for scripts?

 + Is there a script path by default?

 + Can I show the current InDesign configuration settings?

 

Thanks at advance

This topic has been closed for replies.
Correct answer Laubender

@Juan Galarza said: "Currently, I want to know where I should place a script file to execute it."

 

Ok. That's perhaps a different question.

 

At least with the Desktop version of InDesign one could execute a script without getting a permission error/issue from the user's Documents folder if you create a Adobe Scripts folder there. Within that Adobe Scripts folder a scriptFile.execute() should work as intended if the target is defined with the script code.

 

Example for the Desktop version of InDesign 2021:

 

#target indesign-16.064

alert( "InDesign Version:" +"\r"+ app.version );

 

If I have this script file positioned in:

~/Documents/Adobe Scripts/

and do e.g. a double-click on the file it will start up InDesign 2021 if it is not started up yet and will alert the detailed version. Cannot tell that for InDesign Server, because currently I have not installed a server version.

 

Regards,
Uwe Laubender
( Adobe Community Professional )

4 replies

LaubenderCommunity ExpertCorrect answer
Community Expert
August 2, 2022

@Juan Galarza said: "Currently, I want to know where I should place a script file to execute it."

 

Ok. That's perhaps a different question.

 

At least with the Desktop version of InDesign one could execute a script without getting a permission error/issue from the user's Documents folder if you create a Adobe Scripts folder there. Within that Adobe Scripts folder a scriptFile.execute() should work as intended if the target is defined with the script code.

 

Example for the Desktop version of InDesign 2021:

 

#target indesign-16.064

alert( "InDesign Version:" +"\r"+ app.version );

 

If I have this script file positioned in:

~/Documents/Adobe Scripts/

and do e.g. a double-click on the file it will start up InDesign 2021 if it is not started up yet and will alert the detailed version. Cannot tell that for InDesign Server, because currently I have not installed a server version.

 

Regards,
Uwe Laubender
( Adobe Community Professional )

rob day
Community Expert
Community Expert
August 1, 2022

Hi @Juan Galarza , Also not sure if this will work with InDesign Server, but if you run a script directly from the ID Scripts panel there is app.activeScript, this gets the script‘s full path even if it is buried in a subfolder or the User folder:

 

var js = app.activeScript;
alert("The current script’s path is: \r" + js);

 

 

 

Participant
August 1, 2022

Thanks for your help.

Currently, I want to know where I should place a script file to execute it.

I cannot execute the script, therefore I cannot see app.scriptPreferences.scriptsFolder.

I tried moving it into the Scripts folder but the app cannot find it. 

Finally, I decided to copy it into an absolute path and pass the full path in the SOAP invocation.

I want to give only the filename to avoid security issues, but for now, this works. 🙂

Community Expert
August 1, 2022

Sorry. I was wrong!

 

scriptsFolder returns the path to the scripts folder of the individual user, like this path is showing with my German InDesign:

 ~/AppData/Roaming/Adobe/InDesign/Version%2017.0/de_DE/Scripts/Scripts%20Panel

 

Instead try:

app.filePath +"/"+ "Scripts"

 

Regards,
Uwe Laubender
( Adobe Community Professional )

Community Expert
August 1, 2022

Hi @Juan Galarza ,

did you look into the scriptPreferences of the application?

 

app.scriptPreferences.scriptsFolder

 

should return what you want.

 

Regards,
Uwe Laubender
( Adobe Community Professional )