Skip to content

Instantly share code, notes, and snippets.

@natevw
Created August 13, 2012 21:09
Show Gist options
  • Save natevw/3344123 to your computer and use it in GitHub Desktop.
Save natevw/3344123 to your computer and use it in GitHub Desktop.
Resize images in Acorn's "Do Javascript" Automator action
function main(input) {
for (var i = 0, len = input.length(); i < len; i += 1) {
var path = input[i];
var doc = Acorn.open(path);
doc.scaleImageToWidth(300);
doc.saveDocument(null); // NOTE: this *does* drop EXIF orientation, unlike Preview's resize action
doc.close();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment