• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
2

Turn selected AI sublayers into top-level layers?

Guest
Jun 05, 2008 Jun 05, 2008

Copy link to clipboard

Copied

Hi, all!

I wanted to ask if by chance any of the scripting gurus here happen to have written an AI script that will take a number of selected sublayers/sub-sublayers and move them so they become top-level layers?
I am really needing this very badly, given that After Effects can only handle AI layers as separate entities. So I find myself moving tens, even hundreds of nested sublayers to the top level all the time.
Is it possible this script exists already?
TOPICS
Scripting

Views

120.2K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Aug 15, 2008 Aug 15, 2008
This .zip archive contains an AICS3 file and a draft script.

Install the script.
Launch Illustrator.
Open the AI file.

Note that an expanded Blend is on the Artboard. Each object from the former Blend is on its own Layer. The Layers palette contains 100 or so Layers, all named sequentially and nested 10 levels deep.

Run the script a few times. Each time the script runs, an alert tells you the number of existing top-level Layers. It then moves any sublayers nested inside each of those top-leve...

Votes

Translate

Translate
Adobe
New Here ,
Aug 12, 2008 Aug 12, 2008

Copy link to clipboard

Copied

Hello Adolfo,

Could you find a solution for your problem?
As I know the main problem is that a script doesn't see which layers are selected.

Regards,
Tom

--
Stop monotonity. Start productivity.
http://softwareautomation.hu/

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 12, 2008 Aug 12, 2008

Copy link to clipboard

Copied

Have you tried the Release to Layers command from the Layers flyout menu?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 12, 2008 Aug 12, 2008

Copy link to clipboard

Copied

Tom:
I did not find a solution yet (ironically painful, as when I google for my name I get this thread pretty much at the top to remind me!)

Larry: That's the starting point, unfortunately. Release to layers gives you a hierarchy of sublayers and sub-sublayers nested in a top level layer. After Effects can only recognize top level layers as individual entities - sublayers (and AI objects/groups of course) are just internal content for the top level AI levers in AE. I find myself dragging sub and sub-sublayers out to the top level a million times :(

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 06, 2016 Apr 06, 2016

Copy link to clipboard

Copied

Hey guys, I just used the release to layers option (sequence),

once I did that, I was able to drag my sub layers out of their top level layers to make them top level layers,

Hope this helps some

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Sep 26, 2019 Sep 26, 2019

Copy link to clipboard

Copied

You are my hero!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 24, 2020 May 24, 2020

Copy link to clipboard

Copied

What is the trick to physically moving the sublayer out from under the top layer with your mouse? I've done the "Release" command and selected the sublayers, but every time I want to move them out from under, I get the "no can do" icon (circle w/ slash). I've looked at videos and think I must be missing a step. Do I click on something else before tyring to move them?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 24, 2020 May 24, 2020

Copy link to clipboard

Copied

"What is the trick to physically moving the sublayer out from under the top layer with your mouse?"

 

It works with sublayers, but it doesn't work with groups or just objects.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 26, 2020 May 26, 2020

Copy link to clipboard

Copied

Does that mean if any of the sublayers have grouped objects that I must first ungroup them?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 26, 2020 May 26, 2020

Copy link to clipboard

Copied

No I mean that there is a difference between a sublayer and a group.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 12, 2008 Aug 12, 2008

Copy link to clipboard

Copied

Adolfo,

After a little experimentation, making a script that moves sublayers to become top-level layers while maintaining the same relative stacking order between them is fairly trivial.

But what if a layer contains a mix of sublayers and loose objects? Moving the sublayers so that they become top level layers will change the overall stacking order of the illustration, because doing so would move the sublayers to locations above or below the loose objects.

Is that or is that not a problem in your situation?

JET

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 14, 2008 Aug 14, 2008

Copy link to clipboard

Copied

Hi, James.
I think it would not be a problem. There would be no loose objects, since I get the sublayers after using release to layers. So I would only use such a script when objects/groups are already converted to sublayers.

Having this would be great!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 15, 2008 Aug 15, 2008

Copy link to clipboard

Copied

This .zip archive contains an AICS3 file and a draft script.

Install the script.
Launch Illustrator.
Open the AI file.

Note that an expanded Blend is on the Artboard. Each object from the former Blend is on its own Layer. The Layers palette contains 100 or so Layers, all named sequentially and nested 10 levels deep.

Run the script a few times. Each time the script runs, an alert tells you the number of existing top-level Layers. It then moves any sublayers nested inside each of those top-level Layers so that they are top-level Layers.

After you have done this for the number of times necessary in the example, you should see that all the Layers are top-level, and still have the correct stacking order (verified by the correct order of the overlapping paths on the Artboard).

Again, this is just rough and experimental. This is the only file I have tried it on; but I think it should work on any file, given that there are no loose objects inside the subLayers as you described. Also, it does not operate on only selected Layers, as your original post specifies. Perhaps it will help as a starting point.

JET

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 13, 2010 Dec 13, 2010

Copy link to clipboard

Copied

Are there any parameters that you can think of that would cause this script not to function properly?

When I try the script on the provided JET_X_Layers.ai file... it works like a champ - but when I try and use it on a file that I am wanting to separate into top layers... I continually get a script alert saying "1 Top Level Layer(s)", and nothing seems to change in my layer palette.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 24, 2011 Jun 24, 2011

Copy link to clipboard

Copied

Still running into this problem.  This script is a real lifesaver, but I can't get it to work on my files... only the sample file that comes with the script.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 24, 2011 Jun 24, 2011

Copy link to clipboard

Copied

What OS and version of AI?  I just tried it on a file. It takes a couple of steps. First select each master layer in your document and run the Release to Layers (Sequence) from the flyout menu. Then run the script twice. The first time it should tell you the number of atarting layers and the second it will move the layers to the top layer list.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 24, 2011 Jun 24, 2011

Copy link to clipboard

Copied

OS X 10.6.7 using CS5.

I tried releasing to layers (sequence), then ran the script like you suggested, and it told me the number of layers, but then when I try and run it again is just tells me that same number and does nothing in the layer palette.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 24, 2011 Jun 24, 2011

Copy link to clipboard

Copied

Can you post a screenshot of the Layers panel with one of the top layers expanded both before and after running the Release to Layers command? Here's what mine looked like.

Picture 1.pngPicture 2.png

If you can get it to look like the bottom picture, then the script will work.

Picture 5.png

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 14, 2014 Oct 14, 2014

Copy link to clipboard

Copied

Thanks for the script!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 08, 2014 Dec 08, 2014

Copy link to clipboard

Copied

Thank you so much!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 27, 2020 Feb 27, 2020

Copy link to clipboard

Copied

This would be perfect if it also worked with groups. I still have to manually move everything and rename the folders, sadly.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 19, 2008 Aug 19, 2008

Copy link to clipboard

Copied

Hi, James.
I have no words to thank you.
This will be extremely useful. It will really help in taking the sweat out of something I have to do constantly!
I tested very briefly. This week I have major work to do, and I'll let you know. Looks like a real time saver :)
Best,
Adolfo

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 24, 2011 Jun 24, 2011

Copy link to clipboard

Copied

That seems to have done the trick!  I tried it again, and once it was released to layers the script worked for me.

Thanks for your help!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 24, 2011 Jun 24, 2011

Copy link to clipboard

Copied

Glad to help.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 12, 2013 Jun 12, 2013

Copy link to clipboard

Copied

I had the same problem. In Illy CS6, I found a way though.

  1. Release layers (sequence).
  2. Select them all by clicking on the top sub-layer, hold shift and click on the bottom sub-layer.
  3. Drag the whole bunch above the top-level layer they're in. They will all turn into top-level layers.

Unfortunately, the release to layers command doesn't name the sub-layers according to the objects they're in. Aynone has a fix for that?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines