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

Is there a way to automate changing all graphic frames to unassigned frames…

Explorer ,
Nov 07, 2016 Nov 07, 2016

Copy link to clipboard

Copied

A number of our clients supply Word files with graphics embedded, often with too low a resolution or placed with distorted dimensions. It would be helpful to retain placeholders in the layout without keeping the actual unusable graphics (don't want to leave them in and use them by mistake).

Is there a way to automate changing all graphic frames to unassigned frames, preferably being able to set a fill/stroke to identifiy them as placeholders?

TOPICS
Scripting

Views

825

Translate

Translate

Report

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

correct answers 1 Correct answer

Mentor , Nov 07, 2016 Nov 07, 2016

Hi,

So test this code:

#target indesign

var

    mDoc = app.activeDocument,

    mGraphics = mDoc.allGraphics,

    mNone = mDoc.swatches[0],

    mStroke = mDoc.swatches.itemByName(""),

    mFill = mDoc.swatches.itemByName(""),

    cGraphic;

   

while (cGraphic = mGraphics.pop()){

    cGraphic.parent.strokeColor = mStroke.isValid ? mStroke : mNone;

    cGraphic.parent.fillColor = mFill.isValid  ? mFill : mNone;

    cGraphic.remove();

    }

Warning:

All doc's graphics will be removed!

Tip:

Paste a color name from Pan

...

Votes

Translate

Translate
Community Expert ,
Nov 07, 2016 Nov 07, 2016

Copy link to clipboard

Copied

Please post the name of the program you use so a Moderator may move this message to the correct program forum

This forum is not about help with programs... a program would be Photoshop or Dreamweaver or Muse or ???

Votes

Translate

Translate

Report

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
Explorer ,
Nov 07, 2016 Nov 07, 2016

Copy link to clipboard

Copied

Sorry, I'd started in the InDesign forum and hadn't realized I'd been dumped into a general forum. I'm using InDesign CC 2014 through 2017 on Mac OS 10.11.6

Votes

Translate

Translate

Report

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
Community Expert ,
Nov 07, 2016 Nov 07, 2016

Copy link to clipboard

Copied

Moved to InDesign Scripting....

Votes

Translate

Translate

Report

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
Community Expert ,
Nov 07, 2016 Nov 07, 2016

Copy link to clipboard

Copied

When you place the Word document, the graphics will appear in the links panel with names like graphic1111.png. Just drag the new graphic, from finder, Windows Explorer or Bridge right on top of the one you want to replace. When you’re done just go through the links names.

BTW, if you can train them to use proper, high quality graphics, you’re job will already be done. Those images will maintain their original quality.

Votes

Translate

Translate

Report

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
Explorer ,
Nov 07, 2016 Nov 07, 2016

Copy link to clipboard

Copied

BobLevine wrote:

When you place the Word document, the graphics will appear in the links panel with names like graphic1111.png. Just drag the new graphic, from finder, Windows Explorer or Bridge right on top of the one you want to replace. When you’re done just go through the links names.

BTW, if you can train them to use proper, high quality graphics, you’re job will already be done. Those images will maintain their original quality.

Hi Bob,

Thanks for the tip. My problem is that the department head want's "grey boxes" where the bad photos were and after my first round of formatting, she will decide where best to relocate the pictures, after we rescan at a higher quality. She actually wants me to import the text without the graphics then add in the grey boxes where the graphics were in the manuscript. I just figured converting the graphic frames to unassigned and shading them would be a lot faster if there were a script to do that.

re: Training, that's always what I'd prefer, but we get a lot of word of mouth referrals, so a lot of untrained authors with their already completed Word docs knock at our door. Hopefully by their second or third book, we'll have improved their techniques, but the bulk will always be a bit of a mess with bad scans, space runs, paragraph returns instead of page breaks, paragraph returns at the end of each line like it was a typewriter (and boy do I hope they did double paragraph returns between actual paragraphs), etc.. You know, the usual.

Votes

Translate

Translate

Report

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
Mentor ,
Nov 07, 2016 Nov 07, 2016

Copy link to clipboard

Copied

Hi,

So test this code:

#target indesign

var

    mDoc = app.activeDocument,

    mGraphics = mDoc.allGraphics,

    mNone = mDoc.swatches[0],

    mStroke = mDoc.swatches.itemByName(""),

    mFill = mDoc.swatches.itemByName(""),

    cGraphic;

   

while (cGraphic = mGraphics.pop()){

    cGraphic.parent.strokeColor = mStroke.isValid ? mStroke : mNone;

    cGraphic.parent.fillColor = mFill.isValid  ? mFill : mNone;

    cGraphic.remove();

    }

Warning:

All doc's graphics will be removed!

Tip:

Paste a color name from Panel Swatches (line #5 & #6) if your goal is to change Stroke/Fill

Leave them empty ("") if your goal is not to change

Jarek

Votes

Translate

Translate

Report

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
Explorer ,
Nov 07, 2016 Nov 07, 2016

Copy link to clipboard

Copied

Thanks Jump_Over. That works great!. Only change would to be able to set stroke weight, but this will save me lots of time.

Thanks again.

Votes

Translate

Translate

Report

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
Mentor ,
Nov 08, 2016 Nov 08, 2016

Copy link to clipboard

Copied

Hi,

You can extend the power of your scripts using this:

Indesign JavaScript Help

According to above you can include a line:

cGraphic.parent.strokeWeight = "0.5 pt";

Jarek

Votes

Translate

Translate

Report

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
Explorer ,
Nov 08, 2016 Nov 08, 2016

Copy link to clipboard

Copied

LATEST

Thanks for the fish AND the fishing pole.

Roy

Votes

Translate

Translate

Report

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
Community Expert ,
Nov 07, 2016 Nov 07, 2016

Copy link to clipboard

Copied

You could always set the display performance to those images to fast display. Even with an image there, they’ll show as gray.

There’s no way to reassign it with content actually in the frame.

Votes

Translate

Translate

Report

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
Community Expert ,
Nov 07, 2016 Nov 07, 2016

Copy link to clipboard

Copied

Roy - GCG wrote:

A number of our clients supply Word files with graphics embedded, often with too low a resolution or placed with distorted dimensions.

Hi Roy,

speaking about distorted dimensions:


The reason is, that InDesign is ignoring cropping values of images during Word import.

It changes the dimesions of the images to fit the frame's boundaries.

Regards,
Uwe

Votes

Translate

Translate

Report

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
Explorer ,
Nov 07, 2016 Nov 07, 2016

Copy link to clipboard

Copied

Hi Laubender,

Unfortunately, that is not the case. We get a lot of "new" authors and they simply resize the photos to fit their esthetic with no concern about how abnormal the photo contents look as long as it fits on the page they want. They look just as distorted in Word as they do after importing to InDesign.

Votes

Translate

Translate

Report

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