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

How to Replace ( change ) Graphic Frames with other from my choice

New Here ,
Apr 30, 2022 Apr 30, 2022

Copy link to clipboard

Copied

Hello

I have an indesign file consists of 1000 pages with  graphic frames containes 1000 images and I want to replace this graphic frame automatically with another graphic frame from my choice .

How can I do that  .... Is there a script to do that ?

Thanks

 

 

TOPICS
Feature request , How to , Scripting

Views

678

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
New Here ,
Apr 30, 2022 Apr 30, 2022

Copy link to clipboard

Copied

Is there any solution to do that ?

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 ,
Apr 30, 2022 Apr 30, 2022

Copy link to clipboard

Copied

I am not sure to understand. There are 1000 different images and you want to replace each image by 1000 new images?

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
New Here ,
Apr 30, 2022 Apr 30, 2022

Copy link to clipboard

Copied

Thanks for your Replay

No , I want to replace the Placeholder graphic Frames that contain images ( Container ) with another placeholder graphic frame

Images Remain without change

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 ,
Apr 30, 2022 Apr 30, 2022

Copy link to clipboard

Copied

Do you mean you want to change the frame’s fill or stroke? Can you show a screen capture?

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
New Here ,
Apr 30, 2022 Apr 30, 2022

Copy link to clipboard

Copied

No , I want to Change circle Frame shape itself to any another frame shape without changing images

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
New Here ,
Apr 30, 2022 Apr 30, 2022

Copy link to clipboard

Copied

‌‌I found a script called Patheffects ( found in default indesign Scripts ) that makes what I want But containes certain shapes only

I want to change with a shape from my choice

Any solution here

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 ,
Apr 30, 2022 Apr 30, 2022

Copy link to clipboard

Copied

This script will set all the document’s graphic frames to ovals

 

var g = app.documents[0].allGraphics;
for (var i = 0; i < g.length; i++){
    g[i].parent.convertShape(ConvertShapeOptions.CONVERT_TO_OVAL)
};  

 

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
New Here ,
Apr 30, 2022 Apr 30, 2022

Copy link to clipboard

Copied

Thanks for your Reply with this script

And please tell me what can I do if i want to change oval to any other graphic 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 ,
Apr 30, 2022 Apr 30, 2022

Copy link to clipboard

Copied

The convertShape options are:

 

ConvertShapeOptions.CONVERT_TO_BEVELED_RECTANGLE

ConvertShapeOptions.CONVERT_TO_CLOSED_PATH

ConvertShapeOptions.CONVERT_TO_INVERSE_ROUNDED_RECTANGLE

ConvertShapeOptions.CONVERT_TO_LINE

ConvertShapeOptions.CONVERT_TO_OPEN_PATH

ConvertShapeOptions.CONVERT_TO_OVAL

ConvertShapeOptions.CONVERT_TO_POLYGON

ConvertShapeOptions.CONVERT_TO_RECTANGLE

ConvertShapeOptions.CONVERT_TO_ROUNDED_RECTANGLE

ConvertShapeOptions.CONVERT_TO_STRAIGHT_LINE

ConvertShapeOptions.CONVERT_TO_TRIANGLE

 

 

So this would find the ovals with a graphic inside and convert its frame to a rectangle:

 

var g = app.documents[0].allGraphics;
for (var i = 0; i < g.length; i++){
    if (g[i].parent.constructor.name == "Oval") {
        g[i].parent.convertShape(ConvertShapeOptions.CONVERT_TO_RECTANGLE)
    } 
};

 

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
New Here ,
Apr 30, 2022 Apr 30, 2022

Copy link to clipboard

Copied

Big Great thanks For Your Important Replay

I'm sorry for my questions 

If I want to change to graphic frame from my choice ( such as closed path from illustrator )

What can I do or change in the script that you posted ?

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 ,
Apr 30, 2022 Apr 30, 2022

Copy link to clipboard

Copied

A closed path that isn‘t a rectangle or oval would be a polygon. This would get rectangles or polygons and convert them to ovals:

 

var g = app.documents[0].allGraphics;
for (var i = 0; i < g.length; i++){
    if (g[i].parent.constructor.name == "Rectangle" || g[i].parent.constructor.name == "Polygon") {
        g[i].parent.convertShape(ConvertShapeOptions.CONVERT_TO_OVAL)
    } 
};

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
New Here ,
Apr 30, 2022 Apr 30, 2022

Copy link to clipboard

Copied

Great thanks For Your Replay

What about converting this graphic frame to a Any other path from illustrator 

I mean that this path not found in indesign but imported from illustrator 

What thing I change in this script ?

 

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 ,
Apr 30, 2022 Apr 30, 2022

Copy link to clipboard

Copied

Don’t think you can easily do that—the script would have to replace—not convert— all of the frames and relink the graphics.

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
New Here ,
Apr 30, 2022 Apr 30, 2022

Copy link to clipboard

Copied

Great Thanks for your effort 

I assumed that is script ot method to make that

Thanks

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 ,
Apr 30, 2022 Apr 30, 2022

Copy link to clipboard

Copied

"I want to replace this graphic frame automatically with another graphic frame from my choice."

"I assumed that is script ot method to make that."

 

Hi ramy5FDA,

that requires additional effort and more information from your side.

 

Let me explain:

So you copied over an arbitrary shape from Illustrator or you drew your own arbitrary shape in InDesign. It consists of one single path, it is not a compound path object or a group of objects.

 

How would you like to apply that shape to the frames you already have for all of your graphics in your document?

 

[ 1 ] Should all the target's frames stroke or fill be changed to the one you have as a new blueprint?

[ 2 ] Should the size of your blueprint frame be maintained when the target frame's shape is changing?

[ 3 ] Should the new shape be centered to the old shape of the old frame with your graphic?

[ 4 ] Should the position and size of the graphic change when the new frame's shape is applied?

E.g. should the graphic fill the new shape proportionally?

 

Regards,
Uwe Laubender

( ACP )

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
New Here ,
Apr 30, 2022 Apr 30, 2022

Copy link to clipboard

Copied

Thanks for Your Reply

main indesign file that I speak about that created by data merge with images , the current circle frame I put in Master Page 

I want to replace or convert this circle frame to any another frame from illustrator ( not shapes found in indesign ) and images fill the new frame proportionally

 

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 ,
Apr 30, 2022 Apr 30, 2022

Copy link to clipboard

Copied

LATEST

Hm… Then prepare the template layout of your data merge with the shape from Illustrator.

 

Regards,
Uwe Laubender

( ACP )

 

 

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