Skip to content

Instantly share code, notes, and snippets.

View graywithanA's full-sized avatar

Travis Gray graywithanA

View GitHub Profile
@natevw
natevw / gist:3344123
Created August 13, 2012 21:09
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();
}
}