Skip to main content
Pete_7007
Participant
May 26, 2015
Question

how to remove old images from figures folder

  • May 26, 2015
  • 13 replies
  • 984 views

Hi All -

I am working on a large unstructured book in FM11. There are tons of figures (screen shots) residing in the Figure folder(s) that are no longer applicable and just taking up space.

Is there a script or a way to weed out and gong unused screen shots?

Any help would be appreciated.

    This topic has been closed for replies.

    13 replies

    Participating Frequently
    June 11, 2015

    Whatever else you do, keep a copy of the graphics that you believe you no longer need because they are not referenced by your documents. You might later discover that they are used in your documents, but have been imported as a copy, and so do not appear in a list of references. Whereas you could try copying them back out of the FrameMaker document, it's better to have the original source.

    Bob_Niland
    Community Expert
    Community Expert
    May 27, 2015

    re: There may well be other ways, including scripts …

    1. Install the free Archive extension for FM11 & later.
    2. Run it to create a new images directory containing just the used images.
    3. Delete everything in the old Figures directory.
    4. Copy back the used images from the dir created by archive.
    5. Discard the archived copy of the document.

    I've not used this feature, so don't know what exact dir name is created.

    Pete_7007
    Pete_7007Author
    Participant
    May 27, 2015

    Thanks so much for your reply Bob, however I cannot locate the archive extension download you mentioned.

    Arnis Gubins
    Inspiring
    May 27, 2015

    The book archiving extendscript and background info can be found here: Create a Book Packager using Extendscript « TechComm Central by Adobe

    The direct link to the script is: http://blogs.adobe.com/techcomm/files/2011/07/Archive-v2.zip

    Legend
    May 27, 2015

    How about …

    1. generate list of graphics that are used (LOR, set up for Imported graphics)

      I've just checked, and the <$referencename> building-block helpfully pulls in the path as well as the filename

    2. copy existing graphics folder to temporary folder
    3. delete all graphics in original folder (but not the folder)
    4. use LOR to write batch-file that copies (or moves; up to you) all referenced graphics from the temporary folder to the real folder
    5. archive the temporary folder just in case :-}

    There may well be other ways, including scripts …

    Pete_7007
    Pete_7007Author
    Participant
    May 27, 2015

    Appreciate your reply.

    Unfortunately, I've never written a batch file or used a building-block to reveal filename paths.

    Legend
    May 28, 2015

    open .book

    1. Add > List of > References
    2. in the Set-up dialog for the list, move "Imported graphics" into the Include references list
    3. update the book to generate the initial List of references (LOR)

    So far so good … now adjust the LOR if necessary

    1. open the LOR
    2. select View > Reference pages
    3. page down till you see the page that starts [something like] openXmlElementId <$relfilename>:<$UniqueXmlElementId> <$RelativeXmlElementId>
    4. adjust the line that starts <$referencename> as required

      This is the line that pulls in the information you're after; mine reads <$referencename>{tab}<$filename>. The elements between angle brackets are the building blocks, a concept you'll also come across when defining cross-references and autonumbering.

    5. select View > Body pages, save your changes, click on the LOR entry in the book (to set focus on the book) and click Update book to regenerate the LOR

    En passant, I can only envy all of you out there who are allowed to install scripts like responsible adults …