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

How to sort objects alphabetically (inside of a layer)?

New Here ,
Sep 23, 2014 Sep 23, 2014

How to sort objects alphabetically (inside of a layer) on layer list?

I have already tried scripts for Layer sorting. They work indeed for the layers, but not the objects themselves packed inside.

TOPICS
Scripting
26.2K
Translate
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 Beginner , Sep 23, 2015 Sep 23, 2015

 

// sort layers and sublayers by Jung K Kwon
// https://community.adobe.com/t5/illustrator-discussions/how-to-sort-objects-alphabetically-inside-of-a-layer/m-p/13462829#M349907

//#target "Illustrator"
var doc = app.activeDocument;
var Top_all_layers = doc.layers;
Arrange_Layers(doc, Top_all_layers);
redraw();

function Arrange_Layers(where, T_Layers_OBJ) {
    var temp_L_names = new Array();
    for (var i = 0; i < T_Layers_OBJ.length; i++) {
        temp_L_names.push(T_Layers_OBJ[i].name);
  
...
Translate
Adobe
Community Beginner ,
May 22, 2023 May 22, 2023

I just tried copying Jung K Kwon's script today and I am getting this error.  Is there a fix?  

Error.JPG

Sorry for the duplicate entry ... I'm a forum newbie and I didn't know how to insert an image in the original post.

Translate
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 22, 2023 May 22, 2023

copy Jung K Kwon script again, I just fixed a missing index, it should work now.

Translate
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 31, 2023 May 31, 2023

The updated from May 22, 2023 worked perfectly!  Thank you @CarlosCanto !

Translate
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 ,
Jan 09, 2024 Jan 09, 2024

Dangit; not working for me. Have there been any changes? The only code I see to copy is the 2015 post, and it's just radio silence after I run it; no errors, but no change to the layers. 

 

 

Translate
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 09, 2024 Jan 09, 2024
LATEST

the script from Sep 23, 2015 is the one that works

Translate
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