Copy link to clipboard
Copied
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
duplicate method will return a new instance that you can rename for sure.
var newTextFrame = textFrame3.duplicate();
newTextFrame.name = "whatever"
Copy link to clipboard
Copied
duplicate method will return a new instance that you can rename for sure.
var newTextFrame = textFrame3.duplicate();
newTextFrame.name = "whatever"
Copy link to clipboard
Copied
Thanks a lot, somehow I can't seem to find these simple things.
Copy link to clipboard
Copied
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