This content has been marked as final.
Show 6 replies
-
1. Re: action or script to move selection to specified layer?
CarlosCanto May 17, 2013 2:55 PM (in response to steffenunger)here you go
var scale = 50; // 50 means 50%, change this to your needs var idoc = app.activeDocument; var ilayer = idoc.layers['Layer 2']; var sel = idoc.selection; var selen = sel.length; for (i=0; i<selen; i++) { var pgItem = sel[i].duplicate(); pgItem.resize (scale, scale, true, true, true, true, scale, Transformation.CENTER) pgItem.move(ilayer, ElementPlacement.PLACEATEND); } -
2. Re: action or script to move selection to specified layer?
pixxxel schubser May 17, 2013 4:02 PM (in response to CarlosCanto)Hello CarlosCanto,
one question:
why you use the move-methode instead:
//... for (i=0; i<selen; i++) { var pgItem = sel[i].duplicate(ilayer, ElementPlacement.PLACEATEND); pgItem.resize (scale, scale, true, true, true, true, scale, Transformation.CENTER) }What advantages or disadvantages are there?
regards
-
3. Re: action or script to move selection to specified layer?
CarlosCanto May 17, 2013 5:11 PM (in response to pixxxel schubser)Hi pixxxel, I don't think there's a difference, I typed that without thinking, that was the first thing it came to my head...
...but one thing is true about my writing style, if a line starts to get too long to the point where I have to scroll left and right to see all of it, I try to break it as much as I can to make it fit to my screen, this is not the case, but if it was, I would have...
...changed this
pgItem.resize (scale, scale, true, true, true, true, scale, Transformation.CENTER);
to this...
var refpoint = Transformation.CENTER; pgItem.resize (scale, scale, true, true, true, true, scale, refpoint);
-
4. Re: action or script to move selection to specified layer?
pixxxel schubser May 18, 2013 5:17 AM (in response to CarlosCanto)I hope, I understand you right. You mean something like this:
// ... pgItem.resize ( scale, scale, true, true, true, true, scale, Transformation.CENTER )
-
5. Re: action or script to move selection to specified layer?
CarlosCanto May 18, 2013 10:46 AM (in response to pixxxel schubser)that looks much better!! I need to force that into my habits.
-
6. Re: action or script to move selection to specified layer?
steffenunger May 21, 2013 10:53 AM (in response to CarlosCanto)Thanks so much!

