🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.photoshop.scripting
Article #603

Re: Clipping Path Script from lowres to hires

#603
From: Nic_Bereznikov
Date: Sat, 20 Dec 2008 06:43
30 lines
1638 bytes
//This will copy all the paths from one document to another.
#target photoshop
app.bringToFront;
var doc = app.documents[0];
var doc2 = app.documents[1];

activeDocument = doc;
for( var q =0; q< doc.pathItems.length; q++ ) { 	copyPath( doc, doc2, doc.pathItems[q].name ); 	activeDocument = doc; }

function copyPath( From, To, PathName){
	// Select source document
	activeDocument = From;
	// define function
	cTID = function(s) { return app.charIDToTypeID(s); };
	// Select path
	var desc = new ActionDescriptor();
	var ref = new ActionReference();
	ref.putName( cTID( "Path" ), PathName);
	desc.putReference( cTID( "null" ), ref );
	executeAction( cTID( "slct" ), desc, DialogModes.NO );
	// Copy path
	executeAction( cTID( "copy" ), undefined, DialogModes.NO );
	// Select destination document
	activeDocument = To;
	// Paste path
	executeAction( cTID( "past" ), undefined, DialogModes.NO );
	// Deselect path
	desc.putReference( cTID( "null" ), ref );
	executeAction( cTID( "Dslc" ), desc, DialogModes.NO );
}
Technical Details
Message-ID: <59b744f2.2@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!newshub.sdsu.edu!webcrossing
References: <59b744f2.-1@webcrossing.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Thread: f5839,81059690afcd588c
X-Google-Attributes: gidf5839,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: Nic_Bereznikov@adobeforums.com
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!newshub.sdsu.edu!webcrossing
Newsgroups: adobe.photoshop.scripting
Subject: Re: Clipping Path Script from lowres to hires
Message-ID: <59b744f2.2@webcrossing.la2eafNXanI>
Date: Fri, 19 Dec 2008 22:43:42 -0800
References: <59b744f2.-1@webcrossing.la2eafNXanI>
Lines: 33
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit