Finding only the words at a selection point


i beginning put javascript enable me place words in document dictionary , struggling understand relationship between indesign object word , words method , how else might find words within text object @ selection level.

 

select "grapes"  run

app.selection.constructor.name returns  "word"

app.selection.contents returns "grapes"

 

select "grapes,"

app.selection.constructor.name returns "text"

app.selection.words[1].contents returns "grapes," not grapes.

 

any punctuation attached word in selection other whitespace appears considered part of word in words collection.

 

short of resorting regex, there away return word?

 

tia



More discussions in InDesign Scripting


adobe

Comments

Popular posts from this blog

How to change text Component easybook reloaded *newbee* - Joomla! Forum - community, help and support

After Effect warning: A problem occurred when processing OpenGL commands

Preconditions Failed. - Joomla! Forum - community, help and support