Copy link to clipboard
Copied
After placing all the corner logos where I need them, occasionally I need to delete original logo. It lets me to delete the graphic, but not the frame:
myLogo.remove();
myCornerFrame.remove();
The first line works and the second one doesn't.
Thank you for your help.
Yulia
Copy link to clipboard
Copied
Are you sure myCornerFrame is a valid reference?
Is it locked?
Harbs
Copy link to clipboard
Copied
It's name of the variable for the rectangle:
var myCornerFrame = myDoc.pages[0].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.
Yulia
Copy link to clipboard
Copied
Hi Yulia,
This is working for me.
check it out
var myDoc = app.activeDocument;
var myCornerFrame = myDoc.pages[0].rectangles.add (myDoc.layers.item ("Die"));
alert ("deleting.........");
myCornerFrame.remove();
Shonky
Copy link to clipboard
Copied
Maybe it's because there is or was a graphic in it, it doesn't let me to delete it?
Thank you.
Yulia
Copy link to clipboard
Copied
It's working for me also. Check your reference, maybe it's lost somewhere.
--
tomaxxi
http://indisnip.wordpress.com/
Copy link to clipboard
Copied
Yes, you are right, it lost its reference. I used graphic's parent instead and it worked:
myLinkArray[0].parent.remove();
Thank you.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now