
openScriptsFolder();

  function openScriptsFolder() {
    var scriptFile = new File($.fileName);
  
    var directory = scriptFile.parent;
    var docsArr = FilesInFolderDict(directory, '*.jsx');
 

    var namesArr = [];
    
for (var i = 0; i < docsArr.length; i++){
  if(docsArr[i].name != scriptFile.name){
    namesArr.push(docsArr[i].name + ' ');
  }

}

    alert("After clicking OK, the directory 'Scripts' will open. Please move " + namesArr + " script file into the  'Scripts' directory and restart Adobe Illustrator.");
    var aifolder = app.path;
    var localizedFolder = Folder(aifolder + '/Presets.localized');
  
    if (localizedFolder.exists) {
      var presetsFolder = localizedFolder;
    } else {
      var presetsFolder = Folder(aifolder + '/Presets');
    }
  
    if (presetsFolder.exists) {
      var scriptsFolder = Folder(presetsFolder + '/' + $.locale + '/Scripts');
      if (scriptsFolder.exists) {
        scriptsFolder.execute();
      } else {
        alert('Scripts Folder was not found');
      }
    } else {
      alert('Presets folder was not found');
    }
    
   // Open the folder where the openScriptsFolder.jsx script is located
  var scriptFile = new File($.fileName);

  var nativeFolder = scriptFile.parent ;
  
  nativeFolder.execute();
  }

  function FilesInFolderDict(path, cond) {

    var folder = new Folder(path);
    var files = folder.getFiles(cond);
    return files;
  
  };
  