Highlighted

Automate text position in Data Merge

Community Beginner ,
Apr 16, 2020

Copy link to clipboard

Copied

I work with Data Merge in Indesign. Now I have an image and below a text. There are variables in when the image must be present. Now I want the text to be higher if the image is not present. How can I automate that?

Adobe Community Professional
Correct answer by Colin_Flashman | Adobe Community Professional

When doing your data merge, there are several options as to how the variable images appear in terms of their size. If you have all the variable images already at their correct size, from the data merge panel, click on the hamburger icon and select content placement options. From here, select fit frame to content. More info on how that works can be found here: https://colecandoo.com/wp-content/uploads/2012/08/framefit.pdf

Next, place the frame as an inline graphic so that the image and the type are in the same frame but separated by a line break.

So that the frame will shrink if there's nothing there, you have to make a "blank" image in Illustrator - a 1mm rectangle with no fill or stroke is fine, save it as blank.ai. In your data merge text file, any "blank" images will need to reference this blank.ai file.

Topics

How to, Scripting

Views

553

Likes

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

Automate text position in Data Merge

Community Beginner ,
Apr 16, 2020

Copy link to clipboard

Copied

I work with Data Merge in Indesign. Now I have an image and below a text. There are variables in when the image must be present. Now I want the text to be higher if the image is not present. How can I automate that?

Adobe Community Professional
Correct answer by Colin_Flashman | Adobe Community Professional

When doing your data merge, there are several options as to how the variable images appear in terms of their size. If you have all the variable images already at their correct size, from the data merge panel, click on the hamburger icon and select content placement options. From here, select fit frame to content. More info on how that works can be found here: https://colecandoo.com/wp-content/uploads/2012/08/framefit.pdf

Next, place the frame as an inline graphic so that the image and the type are in the same frame but separated by a line break.

So that the frame will shrink if there's nothing there, you have to make a "blank" image in Illustrator - a 1mm rectangle with no fill or stroke is fine, save it as blank.ai. In your data merge text file, any "blank" images will need to reference this blank.ai file.

Topics

How to, Scripting

Views

554

Likes

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
Adobe Community Professional ,
Apr 16, 2020

Copy link to clipboard

Copied

Hi Philip,

I cannot see a direct way to do this.

You could stack the graphic frame and the text frame and give the graphic frame a text wrap.

Later when the merge is finished you would remove all empty graphic frames from the result.

Unfortunately this cannot be done with Object find/replace.

 

FWIW: A custom script could do all this. Pay a scripter to write one for you.

 

Another idea: Do not merge the images through data merge.

Just supply the names of the images in a specific way.

 

@image-name.jpg@

 

A script by Kasyan Servetski would be able to substitute such an image name with the image itself:

 

Place inline images
Kasyan Servetski

http://kasyan.ho.ua/indesign/image/place_inline_images.html

 

Regards,
Uwe Laubender

( ACP )

Likes

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
Reply
Loading...
Participant ,
Apr 19, 2020

Copy link to clipboard

Copied

You could do that in one rush with an external tool if you're on macOS.

MyDataMerge (https://mydatamerge.com) extends InDesigns data merge possibilities a lot and could do this in one rush - they're also pretty fast in their support forum and will help you setting this up (even if we think its a lot more easy than data merge inside InDesign itself).

In your case it can merge groups inline (in one text frame) and remove a text frame if its not used by the image. All in one run 🙂

 

Regards

comshi

Likes

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
Reply
Loading...
Community Beginner ,
Apr 21, 2020

Copy link to clipboard

Copied

MyDataMerge looks great for advanced Data Merge but the big disadvantage for me and the company I work for is that it is only available for Apple operating systems.

Likes

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
Reply
Loading...
Adobe Community Professional ,
Apr 19, 2020

Copy link to clipboard

Copied

When doing your data merge, there are several options as to how the variable images appear in terms of their size. If you have all the variable images already at their correct size, from the data merge panel, click on the hamburger icon and select content placement options. From here, select fit frame to content. More info on how that works can be found here: https://colecandoo.com/wp-content/uploads/2012/08/framefit.pdf

Next, place the frame as an inline graphic so that the image and the type are in the same frame but separated by a line break.

So that the frame will shrink if there's nothing there, you have to make a "blank" image in Illustrator - a 1mm rectangle with no fill or stroke is fine, save it as blank.ai. In your data merge text file, any "blank" images will need to reference this blank.ai file.

Likes

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
Reply
Loading...
Adobe Community Professional ,
Apr 20, 2020

Copy link to clipboard

Copied

Hi Colin,

very clever method!

That blank graphic when no graphic should be placed.

 

Thanks,
Uwe Laubender

( ACP )

Likes

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
Reply
Loading...
Community Beginner ,
Apr 21, 2020

Copy link to clipboard

Copied

This is indeed a very clever and perfectly working minimalist solution. Thank you very much!

Likes

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
Reply
Loading...
Adobe Community Professional ,
Apr 20, 2020

Copy link to clipboard

Copied

Hi Philip,

also see into this thread with a script that can remove all empty graphic frames:

 

Find/Delete All Unused Empty Graphic Frames?
lindsayg96046100, Sep 26, 2018

https://community.adobe.com/t5/indesign/find-delete-all-unused-empty-graphic-frames/td-p/10059345?pa...

 

Hm. Looked into the code in the reply that was marked as Correct. Something is missing there. The original code from Michel has changed after the thread was moved over to this new forum last year. So best try the code that was posted by Rob Day a couple of hours ago in the same thread:

https://community.adobe.com/t5/indesign/find-delete-all-unused-empty-graphic-frames/m-p/11063802#M18...

 

Regards,
Uwe Laubender

( ACP )

Likes

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
Reply
Loading...
Adobe Community Professional ,
Apr 21, 2020

Copy link to clipboard

Copied

I have a script that removes empty frames (Uwe, you helped me with this one and we both tested it fairly extensively). It can be downloaded here: https://colecandoo.com/scripts/ (Look for the text Remove Empty frames)

Likes

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
Reply
Loading...