What's new
Photoshop Gurus Forum

Welcome to Photoshop Gurus forum. Register a free account today to become a member! It's completely free. Once signed in, you'll enjoy an ad-free experience and be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Reply to thread

Full script as follows to copy path from one image to another (have to provide file paths to sourceFile and destinationFile variables in the first two lines),

[CODE]var sourceFile = new File("File path to source file"); // file path to image that has the clipping path

var destinationFile = new File("File path to destination file"); // file path to image to which we want to copy the clipping path from source file


open(sourceFile);

open(destinationFile);


var sourceDoc = documents[0];

var destinationDoc = documents[1];


activeDocument = sourceDoc;


sourceDoc.pathItems[0].select(); //get the top most path from source file


var id122 = charIDToTypeID("copy");

executeAction( id122, undefined, DialogModes.ERROR ); // copy the selected path

   

activeDocument = destinationDoc;


var id126 = charIDToTypeID( "past" );

executeAction( id126, undefined, DialogModes.NO ); // paste the copied path to destination file


sourceDoc.close(SaveOptions.DONOTSAVECHANGES); //close without any changes

destinationDoc.close(SaveOptions.SAVECHANGES); //save with changes


alert("Done");


sourceFile.close();

destinationFile.close();[/CODE]


What is our favorite program/app? (Hint - it begins and ends with the letter P)
Back
Top