What I am trying to do is determine what kind of object each item is. The ultimate goal of this playing is to someday write a script that searches through a document for all items that use a particular color. Rectangles will require a different, simpler approach than a text frame,and I am sure there are other differences that I will have to account for. So I need to know which is which as I go through the page item list.
With the above code, however, I am getting "PageItem" as the constructor.name for each item even though some are rectangles, and some are text boxes.
You might want to take a look at the SelectObjects.jsx example script that's installed with InDesign. While it doesn't do what you want to do, it does show how to traverse page items on a spread and act on them according to their type and/or contents.