Jump to content
Server Maintenance This Week. ×

Reformating a portion of a text field


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

Recommended Posts

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 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This topic is 5690 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.