Skip to content

Instantly share code, notes, and snippets.

@haxpor
Created May 11, 2015 08:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save haxpor/2701f5bbb90c7b330240 to your computer and use it in GitHub Desktop.
Save haxpor/2701f5bbb90c7b330240 to your computer and use it in GitHub Desktop.
Batch translate layer in images residing in a folder for fixed x, and y amount. It will open each image file, then translate, then save the change replacing the file. If translating the layer outside of the image area, photoshop will interrupt and ask you whether or not to save. You can still continue to save manually. But make sure to select to…
var inputFolder = Folder.selectDialog ("Select a folder to process");
var fileList = inputFolder.getFiles("*.png");
for(var i=0; i<fileList.length; i++) {
app.load(fileList[i]);
backFile = app.activeDocument;
backFile.layers[0].translate(10,-3);
backFile.close(SaveOptions.SAVECHANGES);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment