Highlighted

Expressions : Text Object Properties ... Word Index?

Explorer ,
Aug 01, 2020

Copy link to clipboard

Copied

Question : Does the Text Object have a Word Index Property?


What I'm trying to achieve :
You type in a line of text, and via Essential Graphics/Param slider, you select a specific word in that line of text, based on the index, to then be able to give it another color, or to return position/size params to generate a bounding box.

In other words: I type in "This is an example", link an expression to the word index property of the text field, set it to 4 (which would be "example") and then be able to set ONLY the selected word's formatting properties to Bold, #00FF00, etc ... 

Am I asking too much?
I can easily see multiple uses for this, if it hasn't been implemented yet.
Anyone? Anyone? Adobe? Anyone?  😉

Topics

Expressions, How to, Scripting, User interface or workspaces

Views

42

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

Expressions : Text Object Properties ... Word Index?

Explorer ,
Aug 01, 2020

Copy link to clipboard

Copied

Question : Does the Text Object have a Word Index Property?


What I'm trying to achieve :
You type in a line of text, and via Essential Graphics/Param slider, you select a specific word in that line of text, based on the index, to then be able to give it another color, or to return position/size params to generate a bounding box.

In other words: I type in "This is an example", link an expression to the word index property of the text field, set it to 4 (which would be "example") and then be able to set ONLY the selected word's formatting properties to Bold, #00FF00, etc ... 

Am I asking too much?
I can easily see multiple uses for this, if it hasn't been implemented yet.
Anyone? Anyone? Adobe? Anyone?  😉

Topics

Expressions, How to, Scripting, User interface or workspaces

Views

43

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
Most Valuable Participant ,
Aug 01, 2020

Copy link to clipboard

Copied

Simply set the text animator's mode to word and the textIndex and other such stuiff will respond accordingly.

 

Mylenium

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...
Explorer ,
Aug 30, 2020

Copy link to clipboard

Copied

It needs to be driven by expressions, therefor I need the object property.

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...
Adobe Community Professional ,
Aug 30, 2020

Copy link to clipboard

Copied

You can use RegExp to get the word count:

var count = myString.split(/\b[^\s]+\b/).length

 

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...