My client needs multiple crops for a large group of images but keeps changing the guidelines. Since I need to keep working on the files, I'm hoping to import the guidelines into each file from a single file so that I can use them to batch process at the end. The following script seems to be as close to what I need as I've found but it crashes at line 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
}
Any help would greatly be appreciated!