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

Conveniently open the Scripts folder

Community Expert ,
Aug 30, 2021 Aug 30, 2021

Copy link to clipboard

Copied

Hi everyone,

Is there a script or action that will open the location of the Illustrator Scripts folder?

Mike Witherell
TOPICS
Scripting

Views

811

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 2 Correct answers

Community Expert , Aug 30, 2021 Aug 30, 2021

Hi Mike, I've only tested on Mac OS 11.5.2, but this snippet opens the folder that contains the current running script which will be the scripts folder if that's where you saved it.

 

File($.fileName).parent.execute();

 

Edit: to use this, save a text file in your scripts folder (actually whichever folder you want it to open), call it something like "Open Scripts Folder.js" and run it from Illustrator's scripts menu.

- Mark 

Votes

Translate

Translate
Community Expert , Aug 30, 2021 Aug 30, 2021

Hi Mark, I think Mike wants to open the default scripts folder.

 

can you check if the below script works on Mac? Is your language "en_US"?

 

// open default scripts folder
// Carlos Canto

var aifolder = app.path; 
var localizedFolder = Folder(aifolder + '/Presets.localized');       

if (localizedFolder.exists) {
    var presetsFolder = localizedFolder;
    //alert(presetsFolder.fsName);
}
else {
    var presetsFolder = Folder(aifolder + '/Presets');   
    //alert(presetsFolder.fsName);
}

if
...

Votes

Translate

Translate
Adobe
Community Expert ,
Aug 30, 2021 Aug 30, 2021

Copy link to clipboard

Copied

Hi Mike, I've only tested on Mac OS 11.5.2, but this snippet opens the folder that contains the current running script which will be the scripts folder if that's where you saved it.

 

File($.fileName).parent.execute();

 

Edit: to use this, save a text file in your scripts folder (actually whichever folder you want it to open), call it something like "Open Scripts Folder.js" and run it from Illustrator's scripts menu.

- Mark 

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 ,
Aug 30, 2021 Aug 30, 2021

Copy link to clipboard

Copied

Hi Mark, I think Mike wants to open the default scripts folder.

 

can you check if the below script works on Mac? Is your language "en_US"?

 

// open default scripts folder
// Carlos Canto

var aifolder = app.path; 
var localizedFolder = Folder(aifolder + '/Presets.localized');       

if (localizedFolder.exists) {
    var presetsFolder = localizedFolder;
    //alert(presetsFolder.fsName);
}
else {
    var presetsFolder = Folder(aifolder + '/Presets');   
    //alert(presetsFolder.fsName);
}

if (presetsFolder.exists) {
    var scriptsFolder = Folder(presetsFolder + '/' + $.locale + '/Scripts');
    if (scriptsFolder.exists) {
        scriptsFolder.execute();
        //alert(scriptsFolder.fsName);
        //alert(scriptsFolder.getFiles('*.*').toString());
    }
    else {
        alert('Scripts Folder was not found');
    }
}
else {
    alert('Presets folder was not found');
}

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 ,
Aug 30, 2021 Aug 30, 2021

Copy link to clipboard

Copied

Hi Carlos, yes your script works perfectly on Mac OS 11.5.2 and locale is "en_US" ... although I live in Australia. 🙂

- Mark

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 ,
Aug 30, 2021 Aug 30, 2021

Copy link to clipboard

Copied

oh ok, I didn't get that you had to install your script in the right folder first.

My version tries to find the Scripts folder.

 

thanks for confirming it works on 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
Community Expert ,
Aug 30, 2021 Aug 30, 2021

Copy link to clipboard

Copied

So the goal would be this: 

If I want to put a new script in the Scripts folder, I wonder if there is a convenient way of opening to the Scripts folder without having to memorize where that folder is? If a script could open to that very folder, then I could put the new script in quickly and easily.

Mike Witherell

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 ,
Aug 30, 2021 Aug 30, 2021

Copy link to clipboard

Copied

Thanks Mark! At first I didn't understand what you wrote, but then I tried it, ... and it works! Once installed, it makes subsequent visits to that folder simpler and quicker! Many, many thanks to you!

Mike Witherell

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 ,
Aug 30, 2021 Aug 30, 2021

Copy link to clipboard

Copied

Oops I should have made it clearer. You can call the script file something like "Open Script Folder.js". I'm glad you figured it out. 🙂

- Mark

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 ,
Aug 30, 2021 Aug 30, 2021

Copy link to clipboard

Copied

Carlos, your script works, too! Once installed, I can forget where that folder is, but use the script to open that location more conveniently the next time I want to play with a script. I thank you, very much, as well!

🙂

Mike Witherell

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 ,
Aug 30, 2021 Aug 30, 2021

Copy link to clipboard

Copied

you're welcome Mike, my script does not require installation, it can be placed anywhere. But if you know where the Scripts folder is and you just want to make it easy to find, Mark's script makes more sense.

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 ,
Aug 30, 2021 Aug 30, 2021

Copy link to clipboard

Copied

actually if I had to constantly access the Scripts folder I would make a system shortcut to it 🙂

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 ,
Sep 01, 2021 Sep 01, 2021

Copy link to clipboard

Copied

LATEST

That is a work-around good thought, too. I was wishing for a convenience *inside* Illustrator. Thanks again for the help!

Mike Witherell

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