Skip to main content
Inspiring
June 11, 2017
Question

How to associate a name for a text block?

  • June 11, 2017
  • 2 replies
  • 295 views

How to associate a name for a text block in file?

There is a present text block in file. How can I give it a name?

How to call that named text block from script?

This topic has been closed for replies.

2 replies

Stephen Marsh
Community Expert
Community Expert
June 11, 2017

Not sure what you are trying to achieve, the Illustrator Scripting Forum may be a better place for this discussion…

That being said, I use Attributes/Notes to store a unique “hook” against an object, then an action can be used to select objects with the matching “hook”, which can be very useful if one does not know how to script:

Monika Gause
Community Expert
Community Expert
June 11, 2017

In the layers panel you can assign a name to an element.

How to use layers in Illustrator

Inspiring
June 11, 2017

I tried to rename a text object like "text1" from layers palette and try to execute the script:

var myDoc = app.activeDocument;

var textFrame = myDoc['text1'];

textFrame.contents = "111111111";


I get an error