Skip to main content
Inspiring
October 20, 2022
Answered

textFrame duplicate name

  • October 20, 2022
  • 2 replies
  • 387 views

Hi,
one more simple question I can't find.
If I create a duplicate textFrame

textFrame3.duplicate();

is it possible to set the name of the duplicate, or how do I find the name of the duplicate text.Frame.

díky
Thank
Jirka

This topic has been closed for replies.
Correct answer Loic.Aigon

duplicate method will return a new instance that you can rename for sure.

var newTextFrame = textFrame3.duplicate();

newTextFrame.name = "whatever"

2 replies

m1b
Community Expert
Community Expert
October 20, 2022

Hi @jirik79416729,  in addition to @Loic.Aigon's answer, for the purposes of identifying particular objects, you can also get the "index" and the "label". The index is a number that is unique amongst all textFrames in document. The label is just for scripters to use—you can set it in ExtendScript (myTextFrame.label = 'targetMe') or in the Script Label panel in Indesign.

 

A small additional note is that the "name" of an object in Indesign is, by default, empty, but when it is empty the Layers panel will show that object as having a default name, eg. "<text frame>". Once you have set the name, the Layers panel will reflect this change.

 

Also, have a look at some documentation on TextFrame.

-Mark

Loic.Aigon
Loic.AigonCorrect answer
Legend
October 20, 2022

duplicate method will return a new instance that you can rename for sure.

var newTextFrame = textFrame3.duplicate();

newTextFrame.name = "whatever"

Inspiring
October 20, 2022

Thanks a lot, somehow I can't seem to find these simple things.