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

Script to change layer name in to Document name.

$
0
0

Hi I would like to make the active layer name the same as the document name.  I know very little about scripting.  I found this script:

 

var idoc = app.activeDocument;
var ilayer = idoc.activeLayer;
var filename = idoc.name;
ilayer.name = filename;

 

It does almost what I need it to do. except that it also copies the ".ai" in to the layer name.  Is there some way to modify this script to have it exclude or delete the file extension?

 

Thanks for any help.


Viewing all articles
Browse latest Browse all 12845

Trending Articles



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