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?
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
...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 )
Copy link to clipboard
Copied
Hi Uwe.
Thank you for your reply!
It was a great help.