🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #1571

Re: Change name of Layers

#1571
From: Kasyan_Servetsky
Date: Fri, 30 Jan 2009 19:34
30 lines
1376 bytes
Hi Seth McGraw,

What do you mean saying 'default layer': the active layer or "Layer 1"?
The following script renames the active layer.

Kasyan


 
var myDoc = app.activeDocument;
var myListOfLayerNames = ["Silkscreen", "Litho"];

var myDialog = app.dialogs.add({name:"Select a new name for the layer", canCancel:true});
var myColumn = myDialog.dialogColumns.add();
var myPanel = myColumn.borderPanels.add();
with (myPanel.dialogColumns.add()) {
   var myDD = dropdowns.add({stringList:myListOfLayerNames, selectedIndex:0});
}
if (myDialog.show() == true) {
   try {  
      myDoc.activeLayer.name = myListOfLayerNames[myDD.selectedIndex];
   }
   catch(e) {
      alert("Some error occured.");
   }
   myDialog.destroy();
}
else{
   myDialog.destroy();
}
Technical Details
Message-ID: <59b7bc99.0@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.glorb.com!newshub.sdsu.edu!webcrossing
References: <59b7bc99.-1@webcrossing.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,86ce8cc708805021
X-Google-Attributes: gidf939a,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: Kasyan_Servetsky@adobeforums.com
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.glorb.com!newshub.sdsu.edu!webcrossing
Newsgroups: adobe.scripting.indesign
Subject: Re: Change name of Layers
Message-ID: <59b7bc99.0@webcrossing.la2eafNXanI>
Date: Fri, 30 Jan 2009 11:34:27 -0800
References: <59b7bc99.-1@webcrossing.la2eafNXanI>
Lines: 19
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit