Skip to content

Instantly share code, notes, and snippets.

@mach3
Created February 21, 2012 16:56
Show Gist options
  • Save mach3/1877357 to your computer and use it in GitHub Desktop.
Save mach3/1877357 to your computer and use it in GitHub Desktop.
JavaScript for Fireworks CS5 to move selected items to new layers created with those names.
/**
* JavaScript for Fireworks CS5
* Move selected items to new layers created with those names.
*/
(function(){
var sel, dom, debug, i;
sel = fw.selection;
dom = fw.getDocumentDOM();
debug = [];
for(i=0;i<sel.length;i++){
(function(ele){
fw.selection = ele;
dom.addNewLayer(ele.name, false);
dom.clipCut();
dom.clipPaste();
debug.push(ele.name);
})(sel[i]);
}
alert( debug.length + " items have been moved to new layers" );
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment