Photoshop: Ability to delete multiple paths

  • 28
  • Idea
  • Updated 2 months ago
  • Implemented
  • (Edited)
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.
Photo of joshua withers

joshua withers

  • 85 Posts
  • 16 Reply Likes
  • bummed

Posted 8 years ago

  • 28
Photo of Paul Riggott

Paul Riggott

  • 360 Posts
  • 144 Reply Likes
No problem Jeff, here you are...



#target Photoshop
main();
function main(){
if(!documents.length) return;
var doc = activeDocument;
for(var a = doc.pathItems.length-1;a>-1;a--){
if(doc.pathItems[a].name != "Outlined") doc.pathItems[a].remove();
}
RemoveAlphaChannels();
}
function RemoveAlphaChannels() {
var channels = app.activeDocument.channels;
var channelCount = channels.length - 1;
while ( channels[channelCount].kind != ChannelType.COMPONENT ) {
channels[channelCount].remove();
channelCount--;
}
}
Photo of Susan Scott

Susan Scott

  • 16 Posts
  • 1 Reply Like
THANK YOU Paul... it works beautifully! Feels like Christmas this morning! Putting the script into a sweet little action makes my path-heavy photoshop work feel like it's in the 21st century. The one for channels will be quite useful too.
Photo of Jeff Natrop

Jeff Natrop

  • 33 Posts
  • 1 Reply Like
Paul,
WOW!! what a sweet deal.
You made my week!
These work great.
Hmmmm...... now what other photoshop problems can I have you fix?? ;-)

thx
JeffN
Photo of Jeff Natrop

Jeff Natrop

  • 33 Posts
  • 1 Reply Like
Maybe this is not the place to post this, (start a new post?), but while I know that expert Paul Riggot is following this thread I have another question about scripts.

Is it possible to make a square / rectangular selection and have a script add guides to the four sides of the selection?

On most all photographs I shoot I put cropping guides for the client to see what I / we were visioning at the time of the shoot for cropping. I make a marque selection or use the crop tool to crop the image. Then I drag out 4 guides to place around the selection / crop. I deselect or cancel the crop which leaves me with the 4 cropping guides.
This is an often repeated process. I wish I could have a script or something that would put the 4 guides around the selection.

thx
JeffN
Photo of Paul Riggott

Paul Riggott

  • 360 Posts
  • 144 Reply Likes
Nice easy one Jeff....

 

#target Photoshop
main();
function main(){
if(!documents.length) return;
var startRulerUnits = preferences.rulerUnits;
try{
preferences.rulerUnits = Units.PIXELS
var SB = activeDocument.selection.bounds;
}catch(e){return;}
guideLine(SB[1].value,"Hrzn");
guideLine(SB[3].value,"Hrzn");
guideLine(SB[0].value,"Vrtc");
guideLine(SB[2].value,"Vrtc");
preferences.rulerUnits = startRulerUnits;
}
function guideLine(position, type){
var desc = new ActionDescriptor();
var desc2 = new ActionDescriptor();
desc2.putUnitDouble( app.charIDToTypeID('Pstn'), app.charIDToTypeID('#Pxl'), position );
desc2.putEnumerated( app.charIDToTypeID('Ornt'), app.charIDToTypeID('Ornt'), app.charIDToTypeID(type) );
desc.putObject( app.charIDToTypeID('Nw '), app.charIDToTypeID('Gd '), desc2 );
executeAction( app.charIDToTypeID('Mk '), desc, DialogModes.NO );
};

Photo of Jeff Natrop

Jeff Natrop

  • 33 Posts
  • 1 Reply Like
Paul....
"Nice easy One"????
you make me laugh (lol)
I heard Einstein said the same thing when he was asked about he came up with the concept of the "Theory of Relativity".

I'm blown away. I may as well be trying to read Chinese.

The script works perfectly. I can't help but just shake my head....
I've been wishing I had this for years. I thought it was a crazy thing to even ask Adobe about. And here by chance I come across this posting and find that you have solved three issues I've been struggling with.

Thank you hardly seems adequate.

I had no idea that being able to write scripts was so powerful and useful.
If I had it in me to learn how to do this (not sure I do), where would you suggest I go to for clear "how to" instructions.

Thanks for everything. How do I add points to your profile?
You deserve something!!

JeffN
Photo of Paul Riggott

Paul Riggott

  • 360 Posts
  • 144 Reply Likes
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 :)
Photo of Fey Arts

Fey Arts

  • 1 Post
  • 0 Reply Likes
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 :P 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
Photo of Jeanne Rubbo

Jeanne Rubbo, Employee

  • 125 Posts
  • 27 Reply Likes
Official Response
This should now be possible in Photoshop CC with the new multi-path selection capabilities.
Photo of Marius Viken

Marius Viken

  • 2 Posts
  • 0 Reply Likes
This reply was created from a merged topic originally titled Delete all paths option.

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.
Photo of edward.caruso

edward.caruso

  • 153 Posts
  • 42 Reply Likes
Look a few posts above yours, scripting is the way to go.