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

Need a Script to mark Text in InDesign

Community Beginner ,
Mar 21, 2024 Mar 21, 2024

Copy link to clipboard

Copied

Dear Community,

 

I am looking for a .js Script in InDesign that allows me search for a specific text. I haven't found a script yet that is working for me. I need this function for my text replacement project for further functions that allows me to replace the placeholder text in indesign with data from an excel-file.

 

At first, i only need the text finder function. In my example i have 5 textfields on my indesign page. In the first textfield is the text "product1", in the second "product2" and so on until "product5". Now i just need a script that finds these textphrases.

 

Thanks and kind regards

Luca

TOPICS
Scripting

Views

124

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

Community Expert , Mar 22, 2024 Mar 22, 2024

> At first, i only need the text finder function.

 

That's simple enough:

app.findTextPreferences = null;
app.findTextPreferences.findWhat = 'product1';
found = app.activeDocument.findText();

 This returns an array of found text objects.

Votes

Translate

Translate
Community Expert ,
Mar 21, 2024 Mar 21, 2024

Copy link to clipboard

Copied

Can't you use DataMerge?

 

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 Beginner ,
Mar 21, 2024 Mar 21, 2024

Copy link to clipboard

Copied

Hey Robert,

 

no. Datamerge uses templates. But each side is individual. I want to produce a catalog and datamerch is not an option.

 

Thank you anyways! 🙂

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 ,
Mar 21, 2024 Mar 21, 2024

Copy link to clipboard

Copied

quote

Hey Robert,

 

no. Datamerge uses templates. But each side is individual. I want to produce a catalog and datamerch is not an option.

 

Thank you anyways! 🙂


By @LucaKnoop

 

But technically speaking - your document is a template?

 

DataMerge is for producing Catalogues - unless your Catalogue is some special kind?

 

After script will find those 5x texts and update with the data - what next? What with the next record in your database?

 

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 Beginner ,
Mar 21, 2024 Mar 21, 2024

Copy link to clipboard

Copied

each site looks different, has different amounts of products, Header Images and so on. Datamerch is for one template only.

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 ,
Mar 21, 2024 Mar 21, 2024

Copy link to clipboard

Copied

quote

each site looks different, has different amounts of products, Header Images and so on. Datamerch is for one template only.


By @LucaKnoop

 

Yeah, in that case you need a tool that will dynamically add extra rows to the table(s) or place extra icons in the same TextFrame.

 

But if you keep asking "one question at a time" - you won't get a good / complex advice / solution...

 

Will your catalogue be "hardcoded" - each product in a specicif place and won't move - or do you need ability to add / remove / move products?

 

Will each product be a single page / spread or as a smaller module - and multiple modules per page?

 

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 Beginner ,
Mar 21, 2024 Mar 21, 2024

Copy link to clipboard

Copied

I was just asking for a simple text finding 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 ,
Mar 21, 2024 Mar 21, 2024

Copy link to clipboard

Copied

Here is a script to try

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 ,
Mar 22, 2024 Mar 22, 2024

Copy link to clipboard

Copied

LATEST

> At first, i only need the text finder function.

 

That's simple enough:

app.findTextPreferences = null;
app.findTextPreferences.findWhat = 'product1';
found = app.activeDocument.findText();

 This returns an array of found text objects.

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