9 Replies Latest reply: Jan 10, 2011 12:12 PM by CarlosCanto RSS

    Name and Number selected paths?

    Andymc7 Community Member

      I am working on a very large .ai file of a baseball stadium render. It contains many small sections and box seats that need named and numbered in this format: section::100, section::101, ... and so on. Right now, I'm having to go through and rename each path individually. Is there a script that will save me TONS of time by automating this for me?


      I found this one on here, which is a good start for what I need, but it doesn't let me only number selected paths, nor does it let me start the numbering where I want (say at 100 and go up from there).


      #target illustrator


      var docRef = app.activeDocument;
      var newName = prompt ("What's the base of the new name","base");
      var myNB = docRef.pathItems.length;
      for ( i = 1 ; i < myNB; i++)
      var finalName = newName + i;
      docRef.pathItems[i].name = finalName



      Thanks in advance!!