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

Find text and replace with image

Community Beginner ,
Sep 13, 2023 Sep 13, 2023

Hello,

 

I want to find a text, let's say "test" and replace it with an image (ideally .png). Is that possible? Ideally I would like to have an image anchored within the text. I've found the find/change tool under edit, but it seems I must maintain the format. From text to text or image to image; not changing. 

If I have to write a script, that's not a huge issue.

Kevin263201014qby_0-1694624050840.png

 

Thanks very much!

TOPICS
Scripting
1.2K
Translate
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 ,
Sep 13, 2023 Sep 13, 2023

I would say maybe. Try replacing the text with clipboard contents after copying the image to the clipboard

This is going to give you an inline anchored object, if it works, which might not be what you have in mind.

If you provide more info about waht you are doing we might have other suggestions.

Translate
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 Beginner ,
Sep 13, 2023 Sep 13, 2023

I have 73 pages (game cards) where I want to have several different images anchored within the texts. I have all the information I need in excel, it's merged into indesign. 

 

I can't place images into excel cells, so I was hoping to write several strings and just replace them all in indesign. I know I can do it manually, but I'd have to repeat the process about 1,000 times, no exaggeration. Because there is so much to replace, I doubt working with a clipboard will solve it any faster. 

 

I've been working with ChatGPT to write a java script for this, but it's slow and I know little programming. 

 

Thanks very much for any help!

Translate
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
LEGEND ,
Sep 13, 2023 Sep 13, 2023

DataMerge should be able to import images in place. 

 

Or you need custom tool for that - few years ago I've done something like this for PlayFusion - Lightseekers card game - but it requires PSD file with all objects on layers to turn on visibility as required - so you would get final card - texts of course done in InDesign on top. 

 

Translate
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
LEGEND ,
Sep 13, 2023 Sep 13, 2023

And forget about ChatGPT. 

 

Translate
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 ,
Sep 13, 2023 Sep 13, 2023

To do this wuith Data Merge your cell should contain the name of the image file you want to use. If the images are in the same folder as the data file you don't need the complete path, just the filename, but you must include the full path for anything not in the same folder. Image field names must be prefaced with the @ symbol in the name row of the data file.

Translate
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 Beginner ,
Sep 13, 2023 Sep 13, 2023

Close, yes. I am using that trick to place images. But I also want images (icons) anchored within text. 

Translate
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
LEGEND ,
Sep 13, 2023 Sep 13, 2023

You can replace search results with contents of the clipboard - I think it's "^c" - so you need to copy your image into a clipboard first, then do Find&Change.

 

But you can't do it dynamically - in this case only through scripting. 

 

Translate
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 Beginner ,
Sep 13, 2023 Sep 13, 2023

Thank you.

 

Yes... it will replace the text with an image loaded onto the clipboard. I'll see if I can execute this painfull solution.

 

I'll take a look into ID-Tasker too. 

 

Thanks

Translate
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
LEGEND ,
Sep 14, 2023 Sep 14, 2023
LATEST

This kind of functionality - DataMerge and turning on / off layers in the images / PDFs - isn't implemented yet - but if you would like to be a beta tester please let me know. 

 

Translate
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 ,
Sep 13, 2023 Sep 13, 2023

First, import the image you need, on the pasteboard and copy it, using the selection tool (the black arrow). Then run a find-change, searching for the word you need to change and replace it by “other > clipboard content”  (see screenshot in French).

Capture d’écran 2023-09-13 à 19.10.05.png

Capture d’écran 2023-09-13 à 19.12.23.pngCapture d’écran 2023-09-13 à 19.12.39.png

Translate
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 ,
Sep 13, 2023 Sep 13, 2023

I get the sense you want a different image on each card, so the clipboard methos is going to be slower than just placing the images manually. See mey previous response about how to set it up ini Data Merge.

Translate
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