Script: Check if word is hyphenated

Explorer ,
Mar 31, 2021 Mar 31, 2021

Copy link to clipboard

Copied

Hi 🙂

I am wondering if there is a way to check if a word is hyphenated, or a line ends on a hyphenated word.

I can't find anything in the documentation – Do you have any ideas?

TOPICS
Scripting

Views

89

Likes

translate

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

Adobe Community Professional , Mar 31, 2021 Mar 31, 2021
Hi, this was discussed in the old InDesign Scripting forum; one algorithm for "if a word is hyphenated" could work this way:Check the last word of any text line and see if its line length is greater than one.   But before doing an implementation read about the article below, especially see in "Weird Examples of Single-Word Stories":   What Exactly is a Word? Marc Autret, September 04, 2011 https://www.indiscripts.com/post/2011/09/what-exactly-is-a-word   For a different approach see Peter Kahrel...

Likes

translate

Translate

Translate
Adobe Community Professional ,
Mar 31, 2021 Mar 31, 2021

Copy link to clipboard

Copied

Hi,

this was discussed in the old InDesign Scripting forum; one algorithm for "if a word is hyphenated" could work this way:
Check the last word of any text line and see if its line length is greater than one.

 

But before doing an implementation read about the article below, especially see in "Weird Examples of Single-Word Stories":

 

What Exactly is a Word?

Marc Autret, September 04, 2011

https://www.indiscripts.com/post/2011/09/what-exactly-is-a-word

 

For a different approach see Peter Kahrel's script get_hyphens.jsx
Collect hyphenated words
https://creativepro.com/files/kahrel/indesign/hyphens_collect.html

 

Regards,
Uwe Laubender

( ACP )

Likes

translate

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
Explorer ,
Apr 03, 2021 Apr 03, 2021

Copy link to clipboard

Copied

Hi Uwe.

Thank you for your reply!

It was a great help.

Likes

translate

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