我的客户需要对一大组图像进行多种裁剪,但不断更改准则。由于我需要继续处理文件,我希望将指南从单个文件导入每个文件,以便我可以在最后使用它们进行批处理。以下脚本似乎与我发现的一样接近我所需要的,但它在第 6 行崩溃:
file = app.openDialog();//opens dialog,choose one image
if(file[0]){ //if you have chosen an image
app.load(file[0]); //load it into documents
backFile= app.activeDocument; //prepare your image layer as active document
backFile.resizeImage(width,height); //resize image into given size i.e 640x480
backFile.selection.selectAll();
backFile.selection.copy(); //copy image into clipboard
backFile.close(SaveOptions.DONOTSAVECHANGES); //close image without saving changes
doc.paste(); //paste selection into your document
doc.layers[0].name = "BackgroundImage"; //set your layer's name
}
任何帮助将不胜感激!