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]