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

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

449

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

Community Expert , 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

...

Votes

Translate

Translate
Community Expert ,
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 )

Votes

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

LATEST

Hi Uwe.

Thank you for your reply!

It was a great help.

Votes

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