Copy link to clipboard
Copied
Hello to everyone!
I run multiples scripts with my batch.jsx file:
function batch()
{
var f1 = File ( "/Users/dev/Library/Preferences/Adobe\ InDesign/script_1.jsx" );
var f2 = File ( "/Users/dev/Library/Preferences/Adobe\ InDesign/script_2.jsx" );
var f3 = File ( "/Users/dev/Library/Preferences/Adobe\ InDesign/script_3.jsx" );
app.doScript ( f1 );
app.doScript ( f2 );
app.doScript ( f3 );
}
batch();
Is possible get the absolute path without write manually the path:
/Users/dev/Library/Preferences/Adobe\ InDesign/
In this way, when I share this script will work on any Mac computer.
Thanks!
/Users/Users/production/Library/Preferences/Adobe\ InDesign///Users/production/Library/Preferences/Adobe\ InDesign/production/Library/Preferences/Adobe\ InDesign/
Use app.scriptPreferences.scriptsFolder.
See https://www.indesignjs.de/extendscriptAPI/indesign-latest/#ScriptPreference.html
Copy link to clipboard
Copied
( "~/Library/Preferences/Adobe\ InDesign/script_1.jsx" );
Copy link to clipboard
Copied
Hello,
sorry for did simple, I shorted the URL, but really the URL is:
/Users/dev/Library/Preferences/Adobe\ InDesign/Version\ 13.0/en_US/Scripts/Scripts\ Panel/CCLM/Master\ page/01-Number-Header-to-all-pages.jsx
and it is a problem, because when you share with other your script, and they use a different language the folder change from:
en_US to es_ES
Also with the different versions of Adobe Indesign can be a problem.
Do you know any magic key to fix this?
Thanks so much for help me
Copy link to clipboard
Copied
Use app.scriptPreferences.scriptsFolder.
See https://www.indesignjs.de/extendscriptAPI/indesign-latest/#ScriptPreference.html
Copy link to clipboard
Copied
Working!!
thanks so much, both for your help.
var thisScript = new File($.fileName);
var containingFolder = new Folder(thisScript.parent.absoluteURI);
alert("This script is in " + containingFolder.absoluteURI);
var path = containingFolder.absoluteURI;
var appFolder = new Folder(Folder.appPackage.parent.absoluteURI);
alert("The app folder is at " + Folder.decode(appFolder.absoluteURI));
function batch()
{
var f1 = File ( path+"/script_01.jsx" );
var f2 = File ( path+"/script_02.jsx" );
var f3 = File ( path+"/script_03.jsx" );
app.doScript ( f1 );
app.doScript ( f2 );
app.doScript ( f3 );
}
batch();
I have a Mac.