Translating and placing one document into relative path position in second
Im trying to combine two documents
document 1 has a Path with a crop area drawn as a path rectangle, which is also available as guides, this is where the image (an overlay) with a window should be placed...
document 2 the overlay image is an image with a window (transparent area in it) which i can select via action manager. code see below. The selections are not always rectangular on document 2.
N.B the maximum width and height of the window in document 2 exactly match the dimensions of the Path in document 1 (which originates from a capture one crop)
How can I duplicate the Document 2 in document 1 centering the window to the path??
selectTransparent()
function selectTransparent(){
function c2t(s) {return charIDToTypeID(s)}
var d1 = new ActionDescriptor();
var r1 = new ActionReference();
r1.putProperty( c2t( "Chnl" ), c2t( "fsel" ) );
d1.putReference( c2t( "null" ), r1 );
var r2 = new ActionReference();
r2.putEnumerated( c2t( "Chnl" ), c2t( "Chnl" ), c2t( "Trsp" ) );
r2.putEnumerated( c2t( "Lyr " ), c2t( "Ordn" ), c2t( "Mrgd" ) );
d1.putReference( c2t( "T " ), r2 );
executeAction( c2t( "setd" ), d1, DialogModes.NO );
app.activeDocument.selection.invert(); }
