Skip to main content
Mike Witherell
Community Expert
Community Expert
August 30, 2021
Answered

Conveniently open the Scripts folder

  • August 30, 2021
  • 4 replies
  • 1609 views

Hi everyone,

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

This topic has been closed for replies.
Correct answer CarlosCanto

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

4 replies

Mike Witherell
Community Expert
Community Expert
August 30, 2021

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
CarlosCanto
Community Expert
Community Expert
August 30, 2021

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.

CarlosCanto
Community Expert
Community Expert
August 30, 2021

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

Mike Witherell
Community Expert
Community Expert
August 30, 2021

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
m1b
Community Expert
Community Expert
August 30, 2021

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

Mike Witherell
Community Expert
Community Expert
August 30, 2021

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
m1b
Community Expert
Community Expert
August 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 

CarlosCanto
Community Expert
CarlosCantoCommunity ExpertCorrect answer
Community Expert
August 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 (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');
}
m1b
Community Expert
Community Expert
August 30, 2021

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

- Mark