Script for InDesign CS6 - create multiple, prenamed layers

I created a script for Illustrator CS6, in ExtendScript Toolkit, that will create multiple, prenamed layers...see below...
//Apply to myDoc the active document
var layerName = LayerOrderType;
var myDoc = app.activeDocument;
//define first character and how many layers do you need
var layerName
var numberOfLayers=0;
//Create the layers
for(var i=0; i<=numberOfLayers; i++)
{ var layerName = ":: GRADIENT";  var myLayer = myDoc.layers.add(); myLayer.name = layerName;  }
{ var layerName = ":: STRIPES";  var myLayer = myDoc.layers.add(); myLayer.name = layerName;  }
{ var layerName = ":: LEGAL";  var myLayer = myDoc.layers.add(); myLayer.name = layerName;  }
{ var layerName = ":: BLK BAR";  var myLayer = myDoc.layers.add(); myLayer.name = layerName;  }
{ var layerName = ":: FLAME";  var myLayer = myDoc.layers.add(); myLayer.name = layerName;  }
{ var layerName = ":: LOGO/TYPE";  var myLayer = myDoc.layers.add(); myLayer.name = layerName;  }
{ var layerName = ":: TRIM,ETC";  var myLayer = myDoc.layers.add(); myLayer.name = layerName;  }
{ var layerName = ":: LOEC INFO";  var myLayer = myDoc.layers.add(); myLayer.name = layerName;  }
// Moves the bottom layer to become the topmost layer
if (documents.length > 0) {
countOfLayers = activeDocument.layers.length;
if (countOfLayers > 1) {
bottomLayer = activeDocument.layers[countOfLayers-1];
bottomLayer.zOrder(ZOrderMethod.BRINGTOFRONT);
else {
alert("The active document only has only 1 layer")
I tried to use this exact code to replicate the same scenario in InDesign but it doesn't work.
Can anybody help me out!?
Thanks in advance

Marijan Tompa's scripts are very nice and useful, however, for this simple task you can try create your own wiht this code:
app.activeDocument.layers.add ({name: "GRADIENT", layerColor: UIColors.red});
app.activeDocument.layers.add ({name: "STRIPES", layerColor: UIColors.lightBlue});
app.activeDocument.layers.add ({name: "LEGAL", layerColor: UIColors.gray});
//merge existing document layer to bottom layer (in this case original layer will be merged to 'GRADIENT')
var myDocument = app.documents.item(0);
var myLayerA = myDocument.layers.item(2);
          var myLayerB = myDocument.layers.item(3);
          myLayerA.merge(myLayerB);
alert("Layers created!");
assume, your document has one layer.
Script creates three new layers, they appear in Scripts palette in this order:
LEGAL
STRIPES
GRADIENT
and merges 'old' layer to bottom layer of newly created set (GRADIENT).
sure, you can add as much layers as you need, just don't forget modify LayerA and LayerB numbers accordingly.
Or disable second part of the script at all, if you don't want anything to be merged.

Similar Messages

  • Is there an updatedcrossrefs script for InDesign CS6

    Running Mac Pro/2.66 GHz—Quad-Core Intel Xeon/Snow Leopard/
    OS/Mac OS X Version 10.6.2/2.66 GHz
    I converted a CS3 InDesign that uses the script "updatedcrossrefs.js", to CS6 InDesign. This file uses hyperlinks on the TOC and Index.
    I tried using the same script for CS3 InDesign in CS6 InDesign but it does not work.
    This is the error message "Could not catch page. Check destination names and existence."
    Is there an updated script for CS6?

    Sorry did not know I was using bold. My co-worker found this script however, she does not work here anymore. But here is the script. I know nothing about scripts except how to use them. Sorry.
    // Updatecrossrefs.js
    // Updates cross references made with hyperlinks
    // the hyperlink destination is where the reference refers to
    // the hyperlink sourcetext is the text that will be updated (like see xx)
    // If a book is open, the book will be handled,
    // if no book is open, the active document will be handled.
    // Made by Teus de Jong, last version April 10, 2006
    // Revisions by Dave Saunders January 22, 2006 and March 20, 2006
    // Thanks Dave!
    // Added unique naming mechanism for sources -- October, 2008
    if (app.books.length == 0){
              if (app.documents.length == 0){
                        errorExit('No documents are open');
              } else {
                        nrofdocs = 1;
                        doc = app.activeDocument;
    } else {
              nrofdocs = app.books[0].bookContents.length;
              for (i = nrofdocs - 1; i > -1; i--) {
                        if (app.books[0].bookContents[i].status != BookContentStatus.documentIsOpen)
                                  app.open(File(app.books[0].bookContents[i].fullName));
              doc = app.open(app.books[0].bookContents[0].fullName);
    for (d = 1; d <= nrofdocs; d++){
              for (i = 0; i < doc.hyperlinks.length; i++){
                        hyper = doc.hyperlinks[i];
                          // leave ID's own internal markers alone
                        if (hyper.name.substring(0, 1) == '.'){continue}
                          // leave hyperlinks to URLs alone
                          try {
                                  if (hyper.destination.constructor.name == 'HyperlinkURLDestination'){continue}
                        } catch (e) {
                                  hyper.showSource();
                                  errorExit('Selected hyperlink has undefined destination');
                        s = hyper.source.name;
                        // added October, 2008
                        // sometimes ID's unique name mechanism for sources fails; make sure the source has
                        // the same name as the hyperlink + '_src'
                        if (s != hyper.name + '_src')
                                  hyper.source.name = hyper.name + '_src';
                        if (hyper.destination.constructor.name == 'HyperlinkTextDestination'){
                                  s = getParentPageName(hyper.destination.destinationText);
                         } else {
                                   // try/catch added to allow for hyperlinks that have lost their destination -- Dave
                                   try {
                                              s = hyper.destination.destinationPage.name;
                                    } catch (e) { continue }
                        if (s != ''){
                                  // Check to see if update needed; saves a lot of time when processing large books -- Dave
                                  if (hyper.source.sourceText.contents != s) {
                                            hyper.source.sourceText.contents = s;
              if (d >= nrofdocs){
                        break;
              doc = app.open(app.books[0].bookContents[d].fullName);
    function getParentPageName(txt){
              try { 
                        var myFrame = getParentTextFrame(txt);
                        var pag = myFrame.parent;
                        while (pag.constructor.name != 'Page'){
                                  // in case the reference is in an inline, the parent of the frame is a character
                                  if (pag.constructor.name == 'Character'){
                                            pag = getParentTextFrame(pag);
                                  // in case the chain goes sour, back out
                                  if (pag.constructor.name == 'Application'){
                                            throw 'Error';
                                  pag = pag.parent;
                        return(pag.name);
              catch (e) {
                        alert('Could not catch page.\nCheck destination names and existence.');
                        return('');
    function getParentTextFrame(x){
              if(app.version == 3){
                        return(x.parentTextFrame);
              else {
                        return(x.parentTextFrames[0]);
    function errorExit(s){
              alert(s);
              exit();

  • Script for Indesign CS6 - Export Document to preset PDF

    Does anyone know how to do this please?

    Do what? You can't export a document to a preset. You can use a preset to export a document, is that what you mean?
    Check the ESTK object model under Document. Look at the exportFile() method.
    Dave

  • Adobe Indesign CS6 Pricing - Multiple Users

    Hi all,
    I would like to know in detail about the price plans for Indesign version CS6 with multiple user license (maximum 4).
    Please note that, We dont need the creative suite or the CC.
    Reply will be highly appreciated.

    I am tired searching in adobe for Indesign CS6 with multiple user license. I Know they are still selling the CS6 version.
    is there any way to contact adobe other than the forums ???
    Yeah, there is, but why bother?
    Scroll down to InDesign, click the "Buy" link, and click out of the interstitial upsell.
    One caveat: the above link may not work outside the US.

  • ADOBE DPS tutorial downloads - are there any for indesign CS6?

    ADOBE DPS tutorial downloads - are there any for indesign CS6?
    I am in need of tutorial downloads for indesign to learn more on Adobe DPS. I see the many videos online - but would love to download files and construct the files I see. Can anyone help and advise please.
    thanks: Daryl

    If you want good quality exercise files get a subscription to Lynda.com.
    This link will get you a one week trial to see if it's good for you. You'll
    have to pay for the subscription to get the files: http://bit.ly/RS0GXs

  • Adobe Content Viewer for Indesign CS6

    Adobe Content Viewer for Indesign CS6  has disappeared from my application folder, and after downloading AdobeDigitalPublishingCS6 and reinstalling the Content Viewer it still will not launch.
    I have the necessary files and the instller says it was installed successfully…
    Thanks,
    J

    Try following the steps at http://helpx.adobe.com/digital-publishing-suite/kb/manual-install-content-viewer.html.
    Neil

  • Hi how/where do I upgrade plug-ins for InDesign CS6 6.0.6?

    Hi how/where do I upgrade plug-ins for InDesign CS6 6.0.6?

    6.0.6 is CS4, not CS6 (which is version 8).
    Why do you need to upgrade plugins? Are you getting an error  message trying to pen a file? That meas the file was saved from a newer version of ID, and you'll need either the newer version, or an IDML file exported from the original. You can't upgrade plugins to make this work.

  • Downloading a trial for InDesign cs6

    I need to update InDesign CS6 files but only have InDesign CS5.5.
    Cannot download the trial for Creative Suite because I have an older version of system software (10.6.8).
    How do I download a trial version for InDesign CS6?

    Spercomj you can download InDesign CS6 from Download CS6 products.

  • DPS Tools Version 31.0.1 for Indesign CS6 fail to install.

    I'm trying to install DPS Tools Version 31.0.1 for Indesign CS6 however the installer says the update is not applicable. How can I install it?

    Not sure if this was solved for you, but this is what I did...
    In terminal...
    cd /Library/Application Support/Adobe/AAMUpdaterInventory/1.0/
    In there you'll see a file called: "AdobeUpdaterAdminPrefs.dat"
    You may need to change the permissions...
    sudo chmod 666 AdobeUpdaterAdminPrefs.dat
    [ENTER YOUR PASSWORD WHEN PROMTED]
    then ...
    vim AdobeUpdaterAdminPrefs.dat and change the 1 to 0 between the word suppressed, like this...
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <Preferences>
        <Suppressed>0</Suppressed>
    Then kill all adobe software, relaunch photoshop and go to Help>Update. Shouldn't greyed about anymore.
    Does this help?

  • How Can I write Script for Indesign set left indent

    I really need two scripts for indesign set left indent:
    1. If the left indent is: 8, 16, 24, 32, 40, 48, 56mm... set the first -8mm; if the left indent is 0, set the left indent 8mm, first -8mm.
    2. Whatever the first indent is, set the first 8mm.
    Can someone help me?

    Hi, Trevor
    I use change by list as below:
    grep {leftIndent:48mm} {leftIndent:56mm}
    grep {leftIndent:40mm} {leftIndent:48mm}
    grep {leftIndent:32mm} {leftIndent:40mm}
    grep {leftIndent:24mm} {leftIndent:32mm}
    grep {leftIndent:16mm} {leftIndent:24mm}
    grep {leftIndent:8mm} {leftIndent:16mm}
    grep {firstLineIndent:8mm, leftIndent:48mm} {firstLineIndent:8mm, leftIndent:56mm}
    grep {firstLineIndent:8mm, leftIndent:32mm} {firstLineIndent:8mm, leftIndent:48mm}
    grep {firstLineIndent:8mm, leftIndent:24mm} {firstLineIndent:8mm, leftIndent:32mm}
    grep {firstLineIndent:8mm, leftIndent:16mm} {firstLineIndent:8mm, leftIndent:24mm}
    grep {firstLineIndent:8mm, leftIndent:8mm} {firstLineIndent:8mm, leftIndent:16mm}
    grep {firstLineIndent:-8mm, leftIndent:48mm} {firstLineIndent:-8mm, leftIndent:56mm}
    grep {firstLineIndent:-8mm, leftIndent:32mm} {firstLineIndent:-8mm, leftIndent:48mm}
    grep {firstLineIndent:-8mm, leftIndent:24mm} {firstLineIndent:-8mm, leftIndent:32mm}
    grep {firstLineIndent:-8mm, leftIndent:16mm} {firstLineIndent:-8mm, leftIndent:24mm}
    grep {firstLineIndent:-8mm, leftIndent:8mm} {firstLineIndent:-8mm, leftIndent:16mm}
    but not that perfect,
    I want to useing jave "if{}" or "for{}" to write this script, but I don't kown the syntext.

  • InCopyImport.InDesignPlugIn for Indesign CS6

    Is it possible to obtain a fresh copy of the InCopyImport.InDesignPlugIn for Indesign CS6? I have installed Creative Suite CS6 on a fresh iMac 10.8.5 build, and I receive this error when opening Indesign CS6 only. All other applications run fine. AT first I had an issue with 6 or 7 plug-ins, but upon closing and reopening, I am down to just the one error.
    Adobe Indesign does not recognize InCopyImport.InDesignPlugIn as a valid plug-in. Please reinstall the InCopyImport.InDesignPlugIn plug-in and restart Indesign.

    I have both InDesign CS6and InDesign CC 2014 on my computer. The foundation of both is the same. Even the tutorials are identical. So how you can say that CC was built from the ground up is preposterous.
    Without getting into an argument with you. I will explain my frustration more clearly.
    1/ I paid an extortionate amount of money for InDesign CS6 and have been very happy with the results
    2/ It appears that Adobe and you want me to forget the amount of money that I have already invested, bin the old software and buy a subscription to a new more powerful program that was built on the same design. I will receive a meagre discount for the first year and then be charged in the region of £50.00 per month there after. That works out at £600 per calendar year. And a cost that will have to be passed on to my customers
    3/ On other Adobe products they offer an add on for updates. So why can't they offer an add on for the Fixed and reflowable layouts.
    4/ As mentioned in an earlier conversation. I am impressed with the software and will more than likely have to subscribe to CC 2014.
    So lets end this conversation here in the knowledge that I will be buying a subscription .

  • Does Adobe offer the software Pattern Maker for InDesign CS6?

    Does Adobe offer the software Pattern Maker for InDesign CS6?

    That plugin is sold by Teacup Software.
    http://teacupsoftware.com/products/patternmaker1_0.html

  • I have a single user/product subscript for InDesign CS6 creative cloud. Update to CC: how/when?

    I've had a single user/single product subscription for InDesign CS6 since April.  How and when can I update to InDesign CC?

    Karleneme, 17th june onwards
    -LP

  • Problems installing digital publishing update for Indesign CS6

    Hello,
    I am having some problems installing update I need for Indesign CS6. I'm working on an interactive pdf and need to update my version of cs6 to use the digital publishing suite. Upon attempts to use the 'folio builder' I am asked to update and go to 'help' 'updates'. The Adobe Patch installer begins to load then immediately crashes. I have tried installing the publishing update from adobe licensing but the same problem happens when I attempt to install the file using the patch installer.
    I'm using CS6 version 8.0, can anyone help?
    Thanks

    JulianLister I would recommend reviewing your installation logs to determine the cause of your current difficulties.  You can find information on how to locate and interpret your installation log files at Troubleshoot with install logs | CS5, CS5.5, CS6 - http://helpx.adobe.com/creative-suite/kb/troubleshoot-install-logs-cs5-cs5.html.
    Please feel free to post any specific error messages you are receiving to this discussion thread if you have any questions.

  • RTL & Indian Language Support for Indesign CS6 Mac

    Hi,
    I am using Adobe Indesign CS6 Mac version and need support to using Arabic and Indian Language Support. I am not able to write this language. When I am pasting from Word or anywhere text is going cracked.
    I also learn to enable language support from Character setting but I can't find Kashidas option on my Indesign.
    It will be very helpful if some one support how to enable this option or download.
    Best Regards,
    Rakesh

    That's because Larry is correct, and Ellis is correct about you needing to take Larry's advice if you don't have the World-Ready Composer in your menu. You need something like the World Tools plugin from InTools to access the complex-script tools not available in the menus in your install of CS6.
    (Or you could employ Ellis' other suggestion and move to the Cloud. But World Tools is rather less expensive in the long term.)

Maybe you are looking for

  • Account error

    I can't log in to the Firefox account I created several months ago! I used it successfully to Sync bookmarks on multiple computers, but recently I updated firefox and was told to log in to a new version of Sync. I have tried repeatedly to log in to m

  • Thumbnails pics but no large pics. WHAT TO DO. HELP! HELP!

    I can see the images as I scrowl through them in iPhoto, however when I want to make the pages bigger, by double cliking on the them or by viewing them in full screen mode, I get nothing. If I am not in full screen mode I will get a box with an excla

  • IPod requires reset for every new sync

    Well, that's it, really. My late `06 iMac & early `06 60gb / with video iPod are both up-to-date on software, yet everytime I hook it up for an update/sync the "do not disconnect" symbol sits there . . unflashing . & nothing ever happens. Once I do a

  • Release block invoice MRBR

    Hi I have 2 questions to check with you on MRBR. Q1 - why there are invoice shown in this transaction screen as blocked? even though these invoices have been paid in FI side? Q2 - how to make these invoice to disappear on the list in MRBR coz it have

  • Use Of Rational Robot for Testing

    We are trying to use Rational Robot to record our Forms 10g application for playback. It appears that traffic between Jinitiator and the application server is using HTTPS, is this true? When we record the script the data etc is unreadable. Anybody us