Skip to content

Instantly share code, notes, and snippets.

@MegaScience
MegaScience / layers_to_sprite_sheet.js
Last active February 11, 2016 16:29 — forked from jessefreeman/layers_to_sprite_sheet.js
Photoshop Script to turn layers into a spritesheet. Modified from http://www.garagegames.com/community/blogs/view/11527 Now has a UI, all events are under one History item (so one undo undoes the entire script and not just each step of it), etc.
// Put this file in Program Files\Adobe\Photoshop\Presets\Scripts\
// In PhotoShop menu File > Automate > Scripts: layersToSpriteByMS.js
var docRef = app.activeDocument,
numLayers = docRef.artLayers.length;
function main() {
if(documents.length > 0) {
docRef = app.activeDocument,
numLayers = docRef.artLayers.length;
var //activeLayer = docRef.activeLayer,