Highlighted

how get paragraph style and character style of selected text in indesign by script

Community Beginner ,
Aug 15, 2020

Copy link to clipboard

Copied

I want the selected text to be displayed to me when I select a word or text in InDesign by executing the style paragraph script and its style character?

Adobe Community Professional
Correct answer by Manan Joshi | Adobe Community Professional

Try the following

alert(app.selection[0].appliedParagraphStyle.name)
alert(app.selection[0].appliedCharacterStyle.name)

-Manan

TOPICS
How to, Performance, Publish online, Scripting

Views

56

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 get paragraph style and character style of selected text in indesign by script

Community Beginner ,
Aug 15, 2020

Copy link to clipboard

Copied

I want the selected text to be displayed to me when I select a word or text in InDesign by executing the style paragraph script and its style character?

Adobe Community Professional
Correct answer by Manan Joshi | Adobe Community Professional

Try the following

alert(app.selection[0].appliedParagraphStyle.name)
alert(app.selection[0].appliedCharacterStyle.name)

-Manan

TOPICS
How to, Performance, Publish online, Scripting

Views

57

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
Aug 15, 2020 0
Adobe Community Professional ,
Aug 16, 2020

Copy link to clipboard

Copied

Try the following

alert(app.selection[0].appliedParagraphStyle.name)
alert(app.selection[0].appliedCharacterStyle.name)

-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...
Aug 16, 2020 1
Adobe Community Professional ,
Aug 18, 2020

Copy link to clipboard

Copied

Hi tabalvor_andisheh,

it's getting more complicate depending what exactly is selected.

 

There could be more than one character style applied to selected text. You could loop the array of textStyleRanges.

If you selected text that belongs to two or more paragraphs you need to test for all paragraphs in your selection to get a possible range of applied paragraph styles.

 

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...
Aug 18, 2020 0