Highlighted

How to find bold text using script in InDesign document

Explorer ,
Jun 06, 2020

Copy link to clipboard

Copied

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

-Jothi

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

TOPICS
How to, Scripting

Views

534

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

How to find bold text using script in InDesign document

Explorer ,
Jun 06, 2020

Copy link to clipboard

Copied

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

-Jothi

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

TOPICS
How to, Scripting

Views

535

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
Jun 06, 2020 0
Adobe Community Professional ,
Jun 06, 2020

Copy link to clipboard

Copied

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

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...
Jun 06, 2020 1
Explorer ,
Jun 07, 2020

Copy link to clipboard

Copied

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

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...
Jun 07, 2020 0
Explorer ,
Jun 08, 2020

Copy link to clipboard

Copied

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

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...
Jun 08, 2020 0
Adobe Community Professional ,
Jun 07, 2020

Copy link to clipboard

Copied

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

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

Copy link to clipboard

Copied

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

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