SOURCE

//添加参数
var canshu = [0,0,0,0]
var hg = prompt("输入横坐标个数",0)
var hs = prompt("输入横坐标间距",0)
var zg = prompt("输入纵坐标个数",0)
var zs = prompt("输入横坐标间距",0)
canshu[0] = parseFloat(hg)
canshu[1] = parseFloat(hs)
canshu[2] = parseFloat(zg)
canshu[3] = parseFloat(zs)

//复制粘贴
var layer = app.activeDocument.activeLayer;//定义图层对象
layer.copy()//复制新图层
app.activeDocument.paste();//张贴

//归零
var activeLayer = app.activeDocument.activeLayer;
var bounds = activeLayer.bounds;
function zh(wb){
	wb = wb.toString()
	wb = wb.split(" ")[0]
	wb = parseFloat(wb)
	return wb
}
var x = zh(bounds[0])
var y = zh(bounds[1])
var w = zh(bounds[2])
var h = zh(bounds[3])
var layer = app.activeDocument.activeLayer;
layer.translate(-x,-y)
console 命令行工具 X clear

                    
>
console