0 Replies Latest reply on Mar 10, 2009 3:36 AM by mpd323

    CS3 Get ObjectType of pageItem

    mpd323
      Hello,<br /><br />When getting pageitems from a page i have some problems to get their type (e.g. Group, TextFrame). I have found a solution but i do not know if i can get some trouble with using getElements():<br /><br />var curDoc = app.activeDocument;<br />var curPage = curDoc.pages[0];<br />var pageItems = curPage.pageItems;<br /><br />for(var i=0; i<pageItems.length; i++) {<br />     <br />   var curBox = pageItems[i];<br />   var element = curBox.getElements();<br />          <br />   if(element.length > 0) {<br />      var groupItems = element[0];<br />      alert(groupItems.constructor.name);<br />   }<br />}<br /><br />Is there any better solution to get the type of a pageItem? In my case <element> has only one element and i do not know if there is a case where there could be more elements in the array.<br /><br />Thank you, asci