-
-
Save cg-method/c44dad4950e5043578aa1398d55aa4fa to your computer and use it in GitHub Desktop.
【Photoshop】選択したレイヤーを別ドキュメントに複製するスクリプト
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
preferences.rulerUnits = Units.PIXELS; | |
var doc= activeDocument; | |
var layer= doc.activeLayer; | |
var name = layer.name; | |
var w = doc.width; | |
var h = doc.height; | |
var b = doc.activeLayer.bounds; | |
var x1 = parseInt(b[0], 10); | |
var y1 = parseInt(b[1], 10); | |
var x2 = parseInt(b[2], 10); | |
var y2 = parseInt(b[3], 10); | |
var newDoc = documents.add(w, h, 72, name, NewDocumentMode.RGB, DocumentFill.TRANSPARENT); | |
activeDocument = doc; | |
layer.duplicate(newDoc); | |
activeDocument = newDoc; | |
newDoc.crop([x1,y1,x2,y2]); | |
newDoc.layers.getByName('レイヤー 1').remove(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment