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

Absolute Path on Mac to Batch process multiples scripts

Engaged ,
Jun 09, 2018 Jun 09, 2018

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/

TOPICS
Scripting

Views

644

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

correct answers 1 Correct answer

Community Expert , Jun 10, 2018 Jun 10, 2018

Votes

Translate

Translate
Contributor ,
Jun 09, 2018 Jun 09, 2018

Copy link to clipboard

Copied

( "~/Library/Preferences/Adobe\ InDesign/script_1.jsx" ); 

Votes

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
Engaged ,
Jun 10, 2018 Jun 10, 2018

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

Votes

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
Community Expert ,
Jun 10, 2018 Jun 10, 2018

Copy link to clipboard

Copied

Votes

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
Engaged ,
Jun 10, 2018 Jun 10, 2018

Copy link to clipboard

Copied

LATEST

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.

Votes

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