Are you sure myCornerFrame is a valid reference?
Is it locked?
It's name of the variable for the rectangle:
var myCornerFrame = myDoc.pages.rectangles.add (myDoc.layers.item ("Die"));
and I need to delete that rectangle, preferably together with the graphic in it, so I don't need to delete the graphic separately.
Thank you for your help.
This is working for me.
check it out
var myDoc = app.activeDocument; var myCornerFrame = myDoc.pages.rectangles.add (myDoc.layers.item ("Die")); alert ("deleting........."); myCornerFrame.remove();
Maybe it's because there is or was a graphic in it, it doesn't let me to delete it?
Yes, you are right, it lost its reference. I used graphic's parent instead and it worked: