Skip to content

Instantly share code, notes, and snippets.

@christophercotton
Forked from douglashill/App icons.jstalk
Last active December 30, 2015 00:59
Show Gist options
  • Save christophercotton/7753063 to your computer and use it in GitHub Desktop.
Save christophercotton/7753063 to your computer and use it in GitHub Desktop.
Modified the gist to allow it to work with the front most document.
function main(image, doc, layer) {
var sizes = [29, 40, 50, 57, 58, 72, 76, 80, 100, 114, 120, 144, 152, 1024];
for (var idx = 0; idx < sizes.length; idx++) {
doc.scaleImageToWidth(sizes[idx]);
doc.dataRepresentationOfType("public.png").writeToFile("/Users/cotton/Desktop/icon-" + sizes[idx] + ".png");
doc.undo();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment