July 29 2009 • 7:08 PM

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!

8 Responses discussing this post. Add yours below.

  1. July 29th, 2009 • 10:21 pm • Link

    Usually this kind of script should allow us to choose the layer, the page range, a specific objet style,… ;-)

  2. Eugene
    July 30th, 2009 • 3:28 am • Link

    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.

  3. July 30th, 2009 • 5:31 am • Link

    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.

  4. almaink
    July 30th, 2009 • 5:47 am • Link

    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.

  5. July 30th, 2009 • 5:48 am • Link

    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!

  6. David Blatner
    July 30th, 2009 • 5:53 am • Link

    @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).

  7. David Blatner
    July 30th, 2009 • 6:27 am • Link

    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.

  8. Roland
    August 3rd, 2009 • 4:22 am • Link

    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!

Subscribe to the Discussion

Get the ongoing discussion surrounding "Delete Images from Multiple InDesign Graphic Frames Quickly" delivered to you. Click here to subscribe via RSS.

Leave a Reply

You can use limited HTML tags, such as <em></em> for emphasis/italics and <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> .

InDesignSecrets reserves the right to edit and/or remove posts and comments.