4 Replies Latest reply on Aug 26, 2008 10:58 AM by GagnonEric

    How to find page that a graphic is on

    Tom Tomasko Level 1
      I want a result that returns the page number that a graphic is on. The following normally works:

      var pageNumber = app.activeDocument.allGraphics[1].parent.parent.name;

      It works because the first parent is the containing object and the second parent is the page. But if the containing object is grouped with other objects the last parent is Group. This errors out because groups don't have names.

      The following gives me a page number but not necessarily the page which the graphic resides on:

      var pageNumber = app.activeDocument.pages.item(1).name;

      So I am a bit stymied.

      Tom