I think I might be doing this wrong, I am trying to get contents of a specific textFrame within first group on layer called "page numbers"
It seems to work, but is a bit sketchy, the documentation indicates textFrame is all the text frames in a document, and that textFrameItem should be the specific one within collections of groups etc, maybe I am misunderstanding. this is what I am using:
var existingPageNumbers = app.activeDocument.layers.getByName('page numbers').groupItems.textFrames.contents;
is this correct approach...?
that's perfectly correct, it so correct that it is the only way to get it to work, there's no textFrameItem object.
I'm not sure but I think that back in the day, there used to be a textFrameItem when the super class was TextArt or something like that. The documentation is incorrect, check the pageItem section, it correctly indicates "TextFrame" class, while the pageItems section calls it "TextFrameItem" class.