// レイヤーの数を数える var layerCount = activeDocument.artLayers.length; // キャンバスサイズを取得 var canvasWidth = activeDocument.width; var canvasHeight = activeDocument.height; // キャンバスサイズの縦をレイヤーの数*元のキャンバスの高さ preferences.rulerUnits = Units.PIXELS; activeDocument.resizeCanvas(canvasWidth,canvasHeight*layerCount,AnchorPosition.TOPCENTER); alert("レイヤー数は"+layerCount+"です"); alert("キャンバスサイズ横:"+canvasWidth+"キャンバスサイズ縦:"+canvasHeight); // docObj = activeDocument.artLayers; for (i=0; i