textFrames(container, [cb])

Returns a collection of all text frames in the given container. The container object can be a Document, Page, Layer, Group, Story, Page Item or Text Object. If a callback function is given, textFrames() calls this callback function on each text frame of the given container. When the callback function returns false, the loop stops and the textFrames() function returns an array of all text frames up to this point.

Type: function

Parameter(s):

  • container {Document | Page | Layer | Group | Story | PageItem | TextObject}:

    The document, page, layer, group, story, page item or text object to iterate the text frames in.

  • cb {Function} Optional:

    The callback function to call with each text frame. When this function returns false the loop stops. Passed arguments: textFrame, loopCount.

Returns:

  • {Array}:

    An array of Text Frames.