Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe Illustrator Is there a script to automatically rename layers in Illustrator CC?

  • Is there a script to automatically rename layers in Illustrator CC?

    Posted by David Shough on May 7, 2014 at 4:54 pm

    Hello All,

    I am an animator and often have to take complex illustrator artwork and use the “release to layers” command to split up the artwork on individual layers for eventual import and animation in After Effects. It works great, but leaves me with layers with generic names. Sometimes, dozens and dozens of them.

    Anyone know of a way to automatically rename selected layers, perhaps with a script, with something like a search and replace function? For example, instead of 10 layers named “Path 01, Path 02, Path 03,” etc, I would love to be able to rename them “Round Ball 01, Round Ball 02, Round Ball 03, etc.” quickly and efficiently.

    Thanks in advance for your help.

    Dave

    Alan Wasem replied 10 years, 10 months ago 3 Members · 3 Replies
  • 3 Replies
  • Alan Wasem

    July 13, 2015 at 7:12 pm

    Hi I am trying to modify this script by changing the ‘ca’ to something else more relevant to my project in this case ‘PBW’. But I get this error whenever I change it. 

    could someone tell me why this is happening? I would love to be able to rename layers and change the names according to my project.

    #target illustrator
     
    var docRef = app.activeDocument;
     
    with (docRef) {
    for (var i = 0; i < layers.length; i++) {
    layers[i].name = 'ca' + (layers.length - i).toString();
    }
    }


     #target illustrator
     
    var docRef = app.activeDocument;
     
    with (docRef) {
    for (var i = 0; i < layers.length; i++) {
    layers[i].name = ‘PBW’ + (layers.length - i).toString();
    }
    }

  • Vincent Rosati

    July 13, 2015 at 7:45 pm

    I think your single quotes are curly. Try retyping them, single or double quotes, just not curly.

    Vince

    *Please remember to Rate our replies or check Solution if solved. If you get a good idea from the post, consider clicking the Kudos option.

  • Alan Wasem

    July 13, 2015 at 7:59 pm

    that was totally it! Thank you! I just had to turn off smart quotes in text edit.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy