Skip to main content
Geppetto Luis
Legend
September 13, 2017
Answered

Delete action folder preset

  • September 13, 2017
  • 2 replies
  • 1634 views

Lately I'm using a lot of actions

and my folder of preset actions and become too full

there is a script that deletes a folder or action that is in the folder

Presets / Actions in Photoshop

without taking into account the version of photoshop in use.

This topic has been closed for replies.
Correct answer JJMack

I have this script but it does not work

var topLevel = Folder("~/Applications/Adobe Photoshop CC 2014/Presets/Actions/Actions_Install/");

for(var w =0; w<20;w++){

    if(topLevel.exists) folderDelete(topLevel);

    if(!topLevel.exists) break;

}

function folderDelete(topLevel){

var folders =[]; 

folders = FindAllFolders(topLevel, folders);

folders.unshift(topLevel);

for(var a in folders){

var fList=folders.getFiles();

for(var f in fList){

    fList.remove();

        }

    }

folders.reverse();

for(var z in folders){

    folders.remove();

    }

}

function FindAllFolders( srcFolderStr, destArray) {

   var fileFolderArray = Folder( srcFolderStr ).getFiles();

   for ( var i = 0; i < fileFolderArray.length; i++ ) {

      var fileFoldObj = fileFolderArray;

      if ( fileFoldObj instanceof File ) {       

      } else {

         destArray.push( Folder(fileFoldObj) );

      FindAllFolders( fileFoldObj.toString(), destArray );

      }

   }

   return destArray;

}


If the script did work it would only work for CC 2014 that is hard coded onto the script. However it not hard coded to the correct location. It look like your on a Mac.  I do not use a Mac so I do not know if the path hard coded is for your USE ID folder ot Mac OSX Application Photoshop installation.  It also looks like you are trying to delete the a folder. IMO the is not a good Idea.  That may break Adobe's Updates for CC 2014 and updates may through out error code U44M1P7 the installation is corrupt. You may be better off deleting the files within Photoshop's CC 2014 \Presets\actions\ tree  Do that fron finder.  The folder hard coded  is: "~/Applications/Adobe Photoshop CC 2014/Presets/Actions/Actions_Install/" I think the ~ is to your userID Application files not the location of the actual Photoshop version install.

JJMack
Community Expert
Community Expert
September 13, 2017

The answer to your question then is no each version of Photoshop Installer creates a Presets/Actions/ for the version being installed. You would have to remover any action set you do not want to be able to load from each version of Photoshop you install  presets\actions\ You can delete them if you have write access to the folder.  If by cancel you mean delete them..

I save my Actions to my Action folder and load the into my Photoshop Preferences for each versi of Photoshop I use.   Your Usere ID has a set pf preferences for eacj versions at Phoroshop you have installed.  The Action sets you loade into you Actions palette is are stored int uour User IF Photoshop Version preferences foldet for example:

"C:\Users\John J McAssey\AppData\Roaming\Adobe\Adobe Photoshop CC 2017\Adobe Photoshop CC 2017 Settings\Actions Palette.psp"

JJMack
Geppetto Luis
Legend
September 13, 2017

exactly

eliminate them

Geppetto Luis
Legend
September 13, 2017

I have this script but it does not work

var topLevel = Folder("~/Applications/Adobe Photoshop CC 2014/Presets/Actions/Actions_Install/");

for(var w =0; w<20;w++){

    if(topLevel.exists) folderDelete(topLevel);

    if(!topLevel.exists) break;

}

function folderDelete(topLevel){

var folders =[]; 

folders = FindAllFolders(topLevel, folders);

folders.unshift(topLevel);

for(var a in folders){

var fList=folders.getFiles();

for(var f in fList){

    fList.remove();

        }

    }

folders.reverse();

for(var z in folders){

    folders.remove();

    }

}

function FindAllFolders( srcFolderStr, destArray) {

   var fileFolderArray = Folder( srcFolderStr ).getFiles();

   for ( var i = 0; i < fileFolderArray.length; i++ ) {

      var fileFoldObj = fileFolderArray;

      if ( fileFoldObj instanceof File ) {       

      } else {

         destArray.push( Folder(fileFoldObj) );

      FindAllFolders( fileFoldObj.toString(), destArray );

      }

   }

   return destArray;

}

JJMack
Community Expert
Community Expert
September 13, 2017

The would be easyt to do with X's Xtools stdlib.js funcrions

//@show include

//@include "stdlib.js"

Stdlib.deleteAllActionSets = function(confirmDelete) {

if (confirmDelete != false) {

if (!confirm("Do you really want to empty your Actions Palette?")) {

return;

}

}

var sets = Stdlib.getActionSets();

for (var i = sets.length-1; i >= 0; i--) {

Stdlib.deleteActionSet(sets.name);

}

};

Stdlib.deleteAllActionSets();

ALso in Stdlib there is

function loadActionSet(actionSet) {

if (actionSet.exists) { app.load(new File(actionSet)); }

else {alert("Action Set " + actionSet + " does not exists");}

}

JJMack
Geppetto Luis
Legend
September 13, 2017

I want to cancel the actions that are found

in the photoshop preset folder

and not in the action palette