Skip to main content
jjwithers
Inspiring
April 9, 2011
Released

P: Ability to delete multiple paths

  • April 9, 2011
  • 66 replies
  • 1994 views

Why can't you delete more than one path at a time? You can do this with Channels and layers... the path palette hasn't changed in ages.

66 replies

Edward Caruso Photography
Participating Frequently
March 27, 2019
Look a few posts above yours, scripting is the way to go.
Inspiring
March 27, 2019


As a retoucher I use paths a lot. When my images are done I use Image Processor to export the images with a flatten action. After doing this I currently have to go into each image and delete all the paths individually on every image. It would be lovely if a "Delete All Paths" option would be available, so I also could record it do an action and process them out while drinking coffee.
Stephen Marsh
Community Expert
Community Expert
March 23, 2019
I just stumbled across this topic, beware the indiscriminate nature of the following script:

// Remove paths, alphas, layer comps, color samplers & guides
// https://forums.adobe.com/thread/1959150
// https://forums.adobe.com/message/7998834#7998834
#target photoshop
var doc = app.activeDocument;
 
// supress dialog windows
displayDialogs = DialogModes.NO
 
// delete ALL paths, including PathKinds of WORKPATH, NORMALPATH, CLIPPINGPATH & VECTORMASK
doc.pathItems.removeAll();
// delete ALL alphas, including SPOT CHANNELS
doc.channels.removeAll();
 
// delete layercomps
doc.layerComps.removeAll();
 
// delete color samplers
doc.colorSamplers.removeAll();
// delete guides
doc.guides.removeAll();
 

I’m not sure how to exclude SPOT CHANNELS or VECTOR MASKS or CLIPPING MASKS...
Inspiring
September 21, 2015
I'm trying to adapt this script, but I need to keep several paths from deletion.
This is what I have (problem is the the indexOf....) :


function deletepaths()
{
if (!documents.length) return false;

var doc = activeDocument;
var save = ["Ex1", "Ex2", "Ex3"];

for (var x = 0; x < doc.pathItems.length; x++)
{
if (save.indexOf(doc.pathItems[x].name) == -1)
{
doc.pathItems[x].remove();
}
}
}
deletepaths();
Inspiring
June 20, 2014
This is freakin awesome! Thanks
Adobe Employee
June 21, 2013
This should now be possible in Photoshop CC with the new multi-path selection capabilities.
ReneDamkot
Inspiring
February 14, 2013
If I'd have that many paths to delete, I'd write a script for it.
Something like this:

//remove all paths except clipping path

for (var p = 0; thecopy.pathItems.length > p ; ) {
if (thecopy.pathItems[p].kind == PathKind.CLIPPINGPATH) {
p++
}
else {
thecopy.pathItems[p].remove()
}
Inspiring
February 12, 2013
Guys look What I found... you know.. if you make a lot of path you can group it example :(grouping path 2 & 3 into path 1) by first select path 2 > Ctrl+C then select path 1 then Ctrl+V ...then select path 3 Ctrl+C then select path 1 Ctrl+V. simple as that.. well at least if you have 3 path 😛 owh yeah with Mac ofcourse you would use Cmd+C and Cmd+V that's a shortcut for copy & paste. happy pathing~ :)

Btw I'm using Cs6
i4colour
Participant
September 20, 2012
Paul, thank you for taking the time and sharing this!
Paul Riggott
Inspiring
September 5, 2012
There are a few great scripting forums:-

http://forums.adobe.com/community/pho...
http://forums.adobe.com/community/bri...

http://www.ps-scripts.com/bb/

Also there is documentation at:
http://www.adobe.com/devnet/photoshop...

Hope these help and have fun learning 🙂