Quantcast
Channel: Adobe Community : Popular Discussions - Illustrator Scripting
Viewing all articles
Browse latest Browse all 12845

Rename Layer, Group, Object Javascript

$
0
0

Hey Guys,

 

I'm trying to write a script that renames a layer, and group within the layer, then an object within the layer (but not a part of the group) and have it run in a loop.

 

Here's what I've got so far, the group rename doesn't work.

 

 

#target Illustrator

var doc = app.activeDocument;

idLayers(doc)//IRename layers
idGroups(doc)//Rename groups

function idLayers(doc){
    for(i=0;doc.layers.length>i;i++){        doc.layers[i].name= 'id:GTM_Group '+(i+1)        }    }

function idGroups(doc){
    for(i=0;doc.groups.length>i;i++){        doc.groups[i].name= 'id:GTM_Group '+(i+1)        }    }

 

I haven't put in anthing to rename the single object yet since I cant even get the group rename to work. I suspect that the group re-name section isn't working because I'm either using bad syntax or an invalid command. Any ideas?


Viewing all articles
Browse latest Browse all 12845

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>