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

Release to Layers but retain layer names

Explorer ,
Jul 14, 2011 Jul 14, 2011

Copy link to clipboard

Copied

I am unable to find a script that will do this. The default application functionality is really frustrating how it just slaps a generic "Layer 1", "Layer 2" layer name on the new layers. I would rather have the name of the sublayer become the name of the new layer. Has anyone seen a script anywhere that does this?

TOPICS
Scripting

Views

15.5K

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

Community Expert , Apr 21, 2016 Apr 21, 2016

you need to copy and paste the code into any text editor and save it as jsx

Installing scripts in the Scripts menu

To include a script in the Scripts menu (File > Scripts), save the script in the Scripts folder, located in the

/lllustrator CC/Presets folder in your lllustrator CC installation directory. The script’s filename, minus

the file extension, appears in the Scripts menu.

Scripts that you add to the Scripts folder while Illustrator is running do not appear in the Scripts menu until

the next ti

...

Votes

Translate

Translate
Adobe
Community Expert ,
Jul 14, 2011 Jul 14, 2011

Copy link to clipboard

Copied

I'm confused, can you post a screen shot showing your layer structure (with default "layer #" names) and how you want it renamed?

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 ,
Jul 15, 2011 Jul 15, 2011

Copy link to clipboard

Copied

See the image below.

LayersScript.jpg

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 ,
Jul 15, 2011 Jul 15, 2011

Copy link to clipboard

Copied

cool, I'll work on something tonight after work.

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 ,
Jul 17, 2011 Jul 17, 2011

Copy link to clipboard

Copied

here you go, select "Layer 1" and apply Release to Layers (sequence) before running

 

 

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;

     }

 

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
Jul 18, 2011 Jul 18, 2011

Copy link to clipboard

Copied

Thanks! That helps a lot. I think I can add in whatever functionality I need from there.

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 21, 2016 Apr 21, 2016

Copy link to clipboard

Copied

Hi Carlos - I'm not a scripting person and no nothing of syntax. How do I put this script into action on a Mac (Yosemite) using Illustrator CC 2015? What app do I use to write the script? Thanks for the 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 ,
Apr 21, 2016 Apr 21, 2016

Copy link to clipboard

Copied

you need to copy and paste the code into any text editor and save it as jsx

Installing scripts in the Scripts menu

To include a script in the Scripts menu (File > Scripts), save the script in the Scripts folder, located in the

/lllustrator CC/Presets folder in your lllustrator CC installation directory. The script’s filename, minus

the file extension, appears in the Scripts menu.

Scripts that you add to the Scripts folder while Illustrator is running do not appear in the Scripts menu until

the next time you launch Illustrator.

Any number of scripts can be installed in the Scripts menu. If you have many scripts, use subfolders in the

Scripts folder to help organize the scripts in the Scripts menu. Each subfolder is displayed as a separate

submenu containing the scripts in that subfolder.

Executing scripts from the Other Scripts menu item

The Other Scripts item at the end of the Scripts menu (File > Scripts > Other Scripts) allows you to execute

scripts that are not installed in the Scripts folder.

Selecting Other Scripts displays a Browse dialog, which you use to navigate to a script file. When you select

the file, the script is executed.

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
Participant ,
Jan 21, 2021 Jan 21, 2021

Copy link to clipboard

Copied

I keep getting the following error error 1302: no such element sublayer.name = sublayer.pageItems[0].name;

Screenshot (163).png

Any ideas?

 

Thanks

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
Valorous Hero ,
Jan 21, 2021 Jan 21, 2021

Copy link to clipboard

Copied

You have to release to layers first, then run that 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
New Here ,
Nov 20, 2021 Nov 20, 2021

Copy link to clipboard

Copied

hay, i  released the layers and then rund the script but nothing happened, what should i do?

added a screenshot

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 ,
Nov 20, 2021 Nov 20, 2021

Copy link to clipboard

Copied

never mind, problem solved, thanks any way

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 03, 2022 May 03, 2022

Copy link to clipboard

Copied

I'm having and issue where nothing is happening. What solved your problem?

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 09, 2021 Apr 09, 2021

Copy link to clipboard

Copied

Thanks! Save so much time!

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 ,
Aug 25, 2021 Aug 25, 2021

Copy link to clipboard

Copied

Thanks so much Carlos! For some reason I was never notified that there had been a response to my post from 5+ years ago and I just happened to stumble across this. Better late than never! Thanks again - that is definitely something Adobe should have built in years ago.

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 25, 2021 Aug 25, 2021

Copy link to clipboard

Copied

Hi kangyfeet, about time!! Lol

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 20, 2024 Jun 20, 2024

Copy link to clipboard

Copied

You're a lifesaver, 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
New Here ,
May 12, 2022 May 12, 2022

Copy link to clipboard

Copied

Thank You so Much ...  ❤️ its really helpful you are awesome 

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 ,
Oct 31, 2022 Oct 31, 2022

Copy link to clipboard

Copied

It's a miraculous script! Thank you,  @CarlosCanto 

Be alive man! 😄

 

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 ,
Jan 21, 2021 Jan 21, 2021

Copy link to clipboard

Copied

wow 10 years later...

 

what SV said, plus download it again, I just fixed the index issue.

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 25, 2021 Jun 25, 2021

Copy link to clipboard

Copied

10 years and 6 months later! Thank you so much for saving me from renaming 56 layers one at a time!

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 ,
Jul 02, 2021 Jul 02, 2021

Copy link to clipboard

Copied

10 years later and it saves me times from renaming hundreds of assets again because I didn't know that it reset the naming, so thank you so much! Adobe should've implemented what seems like to be a basic QoL feature like this after all these years tbh.

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 ,
Jul 23, 2021 Jul 23, 2021

Copy link to clipboard

Copied

AGREED! This script just made my life so much easier. Can't believe Adobe hasn't updated Illustrator to include this yet. Thank you all for sharing this info!

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 ,
Sep 02, 2021 Sep 02, 2021

Copy link to clipboard

Copied

Thanks a lot Carlos!

I'm a bit lost, could anyone please point the url to download the updated script? I can't find it.

 

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
Guide ,
Sep 02, 2021 Sep 02, 2021

Copy link to clipboard

Copied

https://community.adobe.com/t5/illustrator-discussions/release-to-layers-but-retain-layer-names/m-p/... 

 

Copy and paste it in a jsx file. (You can create a txt file and change the extension to jsx.)  Then, while your document is open in Illustrator, go to File > Scripts > Other Script (Ctrl+F12). Find your script and open it.

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