Answers.Body: <p>found the non-script answer:</p>
  
  <p><div class="youtube-embed"><div>
                  <iframe width="640px" height="395px" src="https://www.youtube.com/embed/AAESBjlo1-o?start=0"></iframe>
              </div></div></p>
  
  <p>Select toplevel layer.
  select release to layers.
  Shift drag sublayers out the top layer.</p>
  
  <p>(from 'learning illustrator')</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-06-01T08:16:03.530Z
Answers.LastActivityDate: 2018-06-01T08:16:03.530Z
Answers.UserDisplayName: Maarten Aerts
Answers.Body: <p>I use this script from Carlos Canto. After releasing layers it will name new top level layers based on sublayer name. The link to the adobe forum is broken now so I don't think this is accessible through there anymore.</p>
  
  <p>It is a little difficult to figure out how to properly select the layers  to make it work. You must select all the objects and also have the top layer selected in the layers palette, like in this screenshot.</p>
  
  <p><a href="https://i.sstatic.net/I814L.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/I814L.png" alt="How to select layers"></a></p>
  
  <p>Thanks Carlos for making this way back in 2014!</p>
  
  <pre><code>// carlos canto // 09/26/14  
  // https://forums.adobe.com/thread/287812  
  var idoc = app.activeDocument;  
  var ilayer = idoc.activeLayer;  
  for (i=0; i&lt;ilayer.layers.length; i++) {  
     var sublayer = ilayer.layers[i];  
     sublayer.name = sublayer.pageItems[0].name || sublayer.pageItems[0].contents;  
  }
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-09-20T00:02:16.837Z
Answers.LastActivityDate: 2017-09-20T14:37:30.477Z
Answers.LastEditDate: 2017-09-20T14:37:30.477Z
Answers.UserDisplayName: Alan
Body: <p>Does anyone know of an Illustrator script that does a "Release to Layers", but renames the layers based on their group names?</p>
  
  <p>I'm sure I had one ages ago, but I can't find it now...</p>
  
  <p>It's very useful when importing complex AI layers to After Effects</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-02-15T22:27:49.447Z
Comments.Text: Since this is about Illustrator (even though the files will go into After Effects), you might get better answers on the [Graphic Design stack exchange site](http://graphicdesign.stackexchange.com/).
Comments.UserDisplayName: BrettFromLA
Tags: <after-effects><script>
Title: Illustrator "Release to Layers" but keep names?
UserDisplayName: tomh
ThreadText: # Illustrator "Release to Layers" but keep names?
  
  (Asked by: username_0 on 2017-02-15)
  
  Does anyone know of an Illustrator script that does a "Release to Layers", but renames the layers based on their group names?
  
  I'm sure I had one ages ago, but I can't find it now...
  
  It's very useful when importing complex AI layers to After Effects
  
  **Tags:** after-effects, script
  
  > **Comments:**
  > **username_1**: Since this is about Illustrator (even though the files will go into After Effects), you might get better answers on the [Graphic Design stack exchange site](http://graphicdesign.stackexchange.com/).  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2018-06-01. Score: 1 | Accepted answer
  
  found the non-script answer:
  
  Select toplevel layer.
  select release to layers.
  Shift drag sublayers out the top layer.
  
  (from 'learning illustrator')
  
  
  ---
  
  ### Answer by username_3 on 2017-09-20. Score: 2
  
  I use this script from Carlos Canto. After releasing layers it will name new top level layers based on sublayer name. The link to the adobe forum is broken now so I don't think this is accessible through there anymore.
  
  It is a little difficult to figure out how to properly select the layers to make it work. You must select all the objects and also have the top layer selected in the layers palette, like in this screenshot.
  
  [![How to select layers](https://i.sstatic.net/I814L.png)](https://i.sstatic.net/I814L.png)
  
  Thanks Carlos for making this way back in 2014!
  
  ```
  // carlos canto // 09/26/14  
  // https://forums.adobe.com/thread/287812  
  var idoc = app.activeDocument;  
  var ilayer = idoc.activeLayer;  
  for (i=0; i<ilayer.layers.length; i++) {  
     var sublayer = ilayer.layers[i];  
     sublayer.name = sublayer.pageItems[0].name || sublayer.pageItems[0].contents;  
  }
  
  ```
  
  
  ---
  
  