Quantcast
Channel: Adobe Community : Popular Discussions - Photoshop Scripting
Viewing all articles
Browse latest Browse all 12244

Need a script for paths and clipping paths

$
0
0

I have over a hundred images (.tif or .TIF) that have clipped with a Path but the names are all different. Also, some have been activated to clipping paths. I need all the Paths/Clipping Paths to be named Path 1. I found an old javascript for this using ExtendScript Toolkit but it doesn't work. Any advice would be greatly appreciated.

 

var selFolder = Folder.selectDialog( 'Location of images to process...' );

var files = selFolder.getFiles ( /.TIF|.tif/i );// may need to edit for different formats

var newPathName = prompt ("Put your clipping path name that you want", 'Path 1', "Clipping Name")   

   for(var f = 0; f < files.length; f++ )

   {

      var doc = app.open( files[f] );

      var numberOfPaths = doc.pathItems.length;

      for( var p = 0; p < numberOfPaths; p++ )

         {

         if( doc.pathItems[ p ].kind == PathKind.CLIPPINGPATH && newPathName !=  doc.pathItems[ p ].name ) doc.pathItems[ p ].name =  newPathName;

         }

   doc.close(SaveOptions.SAVECHANGES);

   }


Viewing all articles
Browse latest Browse all 12244

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>