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

Add a New Layer As a Last Layer

Guest
Jul 24, 2012 Jul 24, 2012

Copy link to clipboard

Copied

Hi Friends,

How to  Add a New Layer As a Last Layer in indesign scripting.

If the Document has 5 layers in the sense,the newly added Layer should be the 6th Layer.

Please Give ideas.

TOPICS
Scripting

Views

969

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

correct answers 1 Correct answer

Advisor , Jul 24, 2012 Jul 24, 2012

l=doc.layers.add();

l.move(LocationOptions.AT_END); //will move it at the bottom of the layers stack.

Votes

Translate

Translate
Advisor ,
Jul 24, 2012 Jul 24, 2012

Copy link to clipboard

Copied

define "last"?

document.layers.add() will add a new layer at the top;

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
Community Expert ,
Jul 24, 2012 Jul 24, 2012

Copy link to clipboard

Copied

JesRoberts wrote:

.. If the Document has 5 layers in the sense,the newly added Layer should be the 6th Layer.

Please Give ideas.

Adding a layer to a set of five will automatically make this the 6th. I cannot see any other way.

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
Guest
Jul 24, 2012 Jul 24, 2012

Copy link to clipboard

Copied

No.Actually the index of the new layer will be 0. so it will be first layer of the doc.

My requirement is that the index of the new layer should be index 5.

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
Guest
Jul 24, 2012 Jul 24, 2012

Copy link to clipboard

Copied

Or How to change the index of the 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
Advisor ,
Jul 24, 2012 Jul 24, 2012

Copy link to clipboard

Copied

LATEST

ok.. i see what you mean. the index of the layer is related with the zOrder.

the topmost layer has the index 0 and the bottom layer has the largest index. also, layes.add() will add a new layer above the currently active layer.

to change the index you have to move the layer. see my previous post

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
Advisor ,
Jul 24, 2012 Jul 24, 2012

Copy link to clipboard

Copied

l=doc.layers.add();

l.move(LocationOptions.AT_END); //will move it at the bottom of the layers stack.

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
Guest
Jul 24, 2012 Jul 24, 2012

Copy link to clipboard

Copied

Thank you so much friend:-)

Actually i am new to this scripting.

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