Specifications

Table Of Contents
Adobe Photoshop CS6
JavaScript Scripting Reference JavaScript Object Reference 95
var selRegion = Array(Array(0, 0),
Array(mergedDoc.width.value, 0),
Array(mergedDoc.width.value, mergedDoc.height.value / 2),
Array(0, mergedDoc.height.value / 2),
Array(0, 0))
// Create the selection
mergedDoc.selection.select(selRegion)
//Paste in the flower
mergedDoc.paste(TRUE)
// do the same thing for the duck
app.activeDocument = duckDoc
duckDoc.activeLayer.copy()
app.activeDocument = mergedDoc
mergedDoc.selection.select(selRegion)
// Inverting the selection so the bottom of the document is now selected
mergedDoc.selection.invert()
// Paste the duck
mergedDoc.paste(TRUE)
// get rid of our originals without modifying them
duckDoc.close(SaveOptions.DONOTSAVECHANGES)
flowerDoc.close(SaveOptions.DONOTSAVECHANGES)
// Reset the application preferences
app.preferences.rulerUnits = startRulerUnits
app.preferences.typeUnits = startTypeUnits
app.displayDialogs = startDisplayDialogs