InDesign Script Path location

New Here ,
Aug 01, 2022 Aug 01, 2022

Copy link to clipboard

Copied

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

TOPICS
How to , Scripting , Server developers

Views

82

Likes

Translate

Translate

Report

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
Adobe Community Professional ,
Aug 01, 2022 Aug 01, 2022

Copy link to clipboard

Copied

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 )

Likes

Translate

Translate

Report

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
Adobe Community Professional ,
Aug 01, 2022 Aug 01, 2022

Copy link to clipboard

Copied

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 )

Likes

Translate

Translate

Report

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
Adobe Community Professional ,
Aug 01, 2022 Aug 01, 2022

Copy link to clipboard

Copied

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

 

Screen Shot 4.png

 

 

Likes

Translate

Translate

Report

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
New Here ,
Aug 01, 2022 Aug 01, 2022

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

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
Adobe Community Professional ,
Aug 02, 2022 Aug 02, 2022

Copy link to clipboard

Copied

LATEST

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

Likes

Translate

Translate

Report

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