Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 5887 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I want to be able to highlight a portion of the text in a field and then run a script to change the text's color. Is there a way to do that?

Thanks

Posted

Sure. Something like:


If [ Get ( ActiveSelectionSize ) ] 

Insert Calculated Result [ TextColor ( Middle ( Get ( ActiveFieldContents ) ; Get ( ActiveSelectionStart ) ; Get ( ActiveSelectionSize ) ) ; RGB ( 240 ; 0 ; 0 ) ) ] 

Else 

Show Custom Dialog [ Message: "Select some text first."; Buttons: “OK” ] 

End If 

Posted

Find the text within a field.

For example the text might be

"The (test) examination is cancelled" assuming the word in parens is actually a strikethrough.

Once the script is run the text would be "The examination is cancelled."

Rich

Posted

That's going to take some work. I suggest you take a look at the GetAsSVG() function. If you direct your script to look for "text-decoration:line-through" in the StyleList branch of the result, you can then extract the Begin and End position indicators, and use them to "by-pass" the striked text. Since there can be more than one such section, your script (or custom function) needs to loop until the style cannot be found.

This topic is 5887 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.