• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How can I move a layer in CS3?

New Here ,
Aug 29, 2008 Aug 29, 2008

Copy link to clipboard

Copied

I'm sure this is a stupid question, but I've looked around and can't seem to figure out how to do this - I need to move a layer from one location to another.

layer.translate won't work, as the move-to location needs to be absolute.

Any help would be appreciated.

Thanks!
TOPICS
Actions and scripting

Views

370

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Valorous Hero ,
Aug 29, 2008 Aug 29, 2008

Copy link to clipboard

Copied

Heres one way of doing it.



var doc = activeDocument;

var oldLayer = doc.artLayers[4]; //layer to move

var actLayer = doc.artLayers[0]; //place before this layer

oldLayer.move( actLayer, ElementPlacement.PLACEBEFORE );

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 29, 2008 Aug 29, 2008

Copy link to clipboard

Copied

Thanks for the quick reply Paul!

I guess I should have been more clear in my original post. I'm trying to change the location of a layer on the canvas.

Maybe I'm wrong, but I think the move method changes the order in the list of layers?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Aug 29, 2008 Aug 29, 2008

Copy link to clipboard

Copied

Yes you are right, but translate should work.
To move to an absolute location you would have to get the layer bounds and work out where to translate to.

var LB = app.activeDocument.activeLayer.bounds;

activeDocument.activeLayer.translate(X,Y);

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 29, 2008 Aug 29, 2008

Copy link to clipboard

Copied

LATEST
Ok, great. Seems like it's a workaround for something you should be able to do more easily. I figured something like this could work, but wasn't sure how to access the bounds of a layer.

Thanks again,
Devin

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines