graphics(container, [cb])

Returns a collection of all graphics in the given container. The container object can be a Document, Page, Layer, Group, Story, Page Item or Text Object. This function can be used to get the graphic within a graphic frame and move it independently of its parent frame. If a callback function is given, graphics() calls this callback function on each graphic of the given container. When the callback function returns false, the loop stops and the graphics() function returns an array of all graphics 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 graphics in.

  • cb {Function} Optional:

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

Returns:

  • {Array}:

    An array of Graphics.