Skip to main content
Inspiring
December 20, 2012
Question

How to rename a layer like filename (with an action)

  • December 20, 2012
  • 3 replies
  • 4628 views

Could anyone help me to rename a layer of illustrator like document file name? (with an action)

Thank you

Mauro

This topic has been closed for replies.

3 replies

Inspiring
December 26, 2012

You can't rename an existing layer with an Action, but you can create a new layer with a specific name, and the name will be recorded.

Therefore, you can make an action that does the following:

(Start on the layer to be renamed)

Lock other layers

Select all

Cut

Delete current layer

Make new layer with desired name

Paste in place

Unlock all layers

Due to a bug in CS6, you can't put the new layer in the same place using the "New layer behind" keyboard shortcut. The new layer is always at the top.

Hope this helps.

mauro8282Author
Inspiring
December 20, 2012

Ok, but what script????

CarlosCanto
Community Expert
Community Expert
December 20, 2012

this one

var idoc = app.activeDocument;

var ilayer = idoc.activeLayer;

var filename = idoc.name;

ilayer.name = filename;

mauro8282Author
Inspiring
December 21, 2012

Thank you,

but Illustrator says:

Error 8: Syntax error.

Line: 1

-> {\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360

I saved your script like a *.jsx

CarlosCanto
Community Expert
Community Expert
December 20, 2012

no can do with actions, you'll have to use a script