Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Delete graphic in InDesign CS5 js

Participant ,
Sep 04, 2010 Sep 04, 2010

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

TOPICS
Scripting
1.2K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 04, 2010 Sep 04, 2010

Are you sure myCornerFrame is a valid reference?

Is it locked?

Harbs

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Sep 07, 2010 Sep 07, 2010

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Sep 07, 2010 Sep 07, 2010

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Sep 08, 2010 Sep 08, 2010

Maybe it's because there is or was a graphic in it, it doesn't let me to delete it?

Thank you.

Yulia

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Sep 09, 2010 Sep 09, 2010

It's working for me also. Check your reference, maybe it's lost somewhere.

--

tomaxxi

http://indisnip.wordpress.com/

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Sep 09, 2010 Sep 09, 2010
LATEST

Yes, you are right, it lost its reference. I used graphic's parent instead and it worked:

myLinkArray[0].parent.remove();

Thank you.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines