is now part of CreativePro.com!

Delete Images from Multiple InDesign Graphic Frames Quickly

Have a bunch of images that you need to delete (but you want to keep the graphic frames)? You could shift-click and press delete like crazy… or you could use this script by Peter Kahrel.

It’s a simple little thing: If you have one or more frames selected, it removes the contents (but only images… not text). If you don’t have any frame selected when you run the script, it deletes every image throughout your document. Cool!

(Well, it’s only cool if you meant to do it. There is no “are you sure you want to do that?” alert. So be sure you know what you’re doing. I usually recommend people save a document before running a script like this, to make it easier to Revert if you find you need to go back.

You can download the script here (it’s a zip file which you can uncompress and place in your scripts folder).

Thank you, Peter!

David Blatner is the co-founder of the Creative Publishing Network, InDesign Magazine, and the author or co-author of 15 books, including Real World InDesign. His InDesign videos at LinkedIn Learning (Lynda.com) are among the most watched InDesign training in the world. You can find more about David at 63p.com.
  • Usually this kind of script should allow us to choose the layer, the page range, a specific objet style,… ;-)

  • Eugene says:

    Yeh, it would be nice if this script worked on a page range. And also across a book. I have a bi-monthly magazine that I need to remove all images from each issue. It’s in book panel (don’t ask) and it would be cool to select a bunch of the documents and run the script or vice versa.

    However, neato scripto.

    Cheers.

  • Great script again. Thanks Peter!

    One little problems with it, the script fail if any image frame have been locked or are on a locked layer.

    I share the script with someone else (Michel Vrana from http://www.blackeye.com/) and he change one line so It remove all graphics on the current active layer only.

    so find this line:

    myGraphics = app.documents[0].allGraphics;

    and change it to

    myGraphics = app.documents[0].activeLayer.allGraphics;

    Than select the layer in the layer panel and run the script with nothing selected.

  • almaink says:

    Selective relinking in the links pallet is a better option IMO. Scripts are nice don’t get me wrong I use a lot of them, but for switching images I like to see whats going on and adjust as I go. Relinking has that advantage.

  • Michel Vrana says:

    Just a follow up on Jean-Claude’s posting. J-C had given me the script in response to a call for help that I made on twitter.

    Why did I need it? I was creating a spot varnish plate for all the images in a 200 page coffee table book. Now, I wasn’t able to test the script with that project (it had to be done before I heard from J-C) But I did try it out (with my modification) and it works great.

    So, how to use the script to create your varnish?

    Dupe layer with images.

    Select new layer.

    Run script.

    Run object find/replace to find all image boxes on the layer and replace with fill with spot varnish (overprint).

    VoilĂ ! Spot varnish!

  • David Blatner says:

    @Michel & JC: Thanks for the update! There is no doubt that it’s nicer to be able to have more control over what is removed. This was just a freebie that Peter put together quickly for everyone. As always, feel free to contact the author and offer to pay him a little sum to customize it/enhance it, etc.

    @almaink: Sorry, I don’t understand your comment. This script has nothing to do with Relinking; it just throws away images (something you cannot do in the Links panel).

  • David Blatner says:

    UPDATE! Peter sent me a new version (available at the link in the blog post) which does offer an alert before deleting all images in a document, and avoids images that are on locked layers.

  • Roland says:

    I’ve never had to delete all images in a multi-page document, so I always just hit A to get the direct select tool and then click in the graphics frames and hit the delete key.

    By the way, David, you linked to a “what InDesign can’t do” post in a reply to another post but that list is inaccurate (see my reply). Think you could update it?

    On a whole other note: it’s summer holidays over here, and I’m sinning by being at work for a few minutes right now, so please excuse me if I don’t come here over the next 3 weeks as I’ll be reading (Dante’s Devine Comedy), gaming and enjoying my newly gifted hookah far too much :P
    Have a good summer everybody!

  • DeFliGra says:

    Brilliant script… if you’re creating magazines and reuse your Indesign document. Click the script > gone are all the missing links and all the images. Saves you 5 minutes here and there. Of course… you’ll have to prepare your document > put images, logos you don’t want deleted on separate locked layers.

    Very nice script. Thx.

  • >