Sorry, I just stopped the error. I checked it out in detail after that.
The fact that Rectangle does not have the images, epss, pdfs properties was the reason it was ignored.
This part
if((myIsInArray(myPageItem.getElements()[0].constructorName, myObjectTypes) == true) ||
((myIsInArray("images", myObjectTypes) == true) && (myPageItem.images.length == 1))||
((myIsInArray("epss", myObjectTypes) == true) && (myPageItem.epss.length == 1))||
((myIsInArray("pdfs", myObjectTypes) == true) && (myPageItem.pdfs.length == 1))
should be like this
if((myIsInArray(myPageItem.getElements()[0].constructorName, myObjectTypes) == true) ||
((myIsInArray("images", myObjectTypes) == true) && (myPageItem.allGraphics[0].constructorName == 'Image'))||
((myIsInArray("epss", myObjectTypes) == true) && (myPageItem.allGraphics[0].constructorName == 'EPS'))||
((myIsInArray("pdfs", myObjectTypes) == true) && (myPageItem.allGraphics[0].constructorName == 'PDF'))
... View more