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

How to find bold text using script in InDesign document

Contributor ,
Jun 06, 2020 Jun 06, 2020

How to find the bold text in indesign document by running script in script panel. Please guide me.........

-Jothi

TOPICS
How to , Scripting
3.8K
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

correct answers 2 Correct answers

Community Expert , Jun 07, 2020 Jun 07, 2020

I did not quite follow what you want, to get all the text of the document you could use the following code. It does not care about the formatting applied to the text

app.activeDocument.stories.everyItem().contents

 

To get the content of a textframe you need to refer its contents property

-Manan

Translate
Contributor , Jun 07, 2020 Jun 07, 2020

ok 1'll explain you what i'm trying to do is, I have generated an xml including <bol></bol> tag for some text. After drag and drop the contents from xml in InDesign document the text included in <bol></bol> tag gets bold. But, in our plugin after using liveupdate the bold tag disappears in the database but it present in the xml. i don't know what to do with it. i'm searching to do liveupdate with all tags that applied in the xml must apply to the database. Is there ia a way??? The reason i have

...
Translate
Community Expert ,
Jun 06, 2020 Jun 06, 2020

You can use the Find/Change feature to find the font style. The following script would do that

app.findTextPreferences = NothingEnum.nothing;
app.findTextPreferences.fontStyle = "Bold"
var find = app.activeDocument.findText ();
app.findTextPreferences = NothingEnum.nothing;
alert("Found " + find.length + " occurence")

 

-Manan

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
Contributor ,
Jun 07, 2020 Jun 07, 2020

Yeah! It's shows the bold text count. I have an another doubt (for.eg., In InDesign document i have contents with bold text and unbold text in a same textframe by using the script i need to fetch all texts in the InDesign document without missing the bold text and unbold text is it possible)

-Jothi

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
Contributor ,
Jun 08, 2020 Jun 08, 2020
LATEST

Hi Manan,

I have an another problem the code that you have given displays the count of bold text. How to display the content of the bold text i have tried but it shows undefined. Please guide me

-Jothi

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 ,
Jun 07, 2020 Jun 07, 2020

I did not quite follow what you want, to get all the text of the document you could use the following code. It does not care about the formatting applied to the text

app.activeDocument.stories.everyItem().contents

 

To get the content of a textframe you need to refer its contents property

-Manan

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
Contributor ,
Jun 07, 2020 Jun 07, 2020

ok 1'll explain you what i'm trying to do is, I have generated an xml including <bol></bol> tag for some text. After drag and drop the contents from xml in InDesign document the text included in <bol></bol> tag gets bold. But, in our plugin after using liveupdate the bold tag disappears in the database but it present in the xml. i don't know what to do with it. i'm searching to do liveupdate with all tags that applied in the xml must apply to the database. Is there ia a way??? The reason i have asked about the scripting is to check wheather i can get the document contents with applied styles or not..

-Jothi

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