rsagall Posted October 8, 2008 Posted October 8, 2008 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
comment Posted October 8, 2008 Posted October 8, 2008 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
rsagall Posted October 9, 2008 Author Posted October 9, 2008 That's works fine. Now I need to be able to find text that is formatted as "strikethough" and delete it. Thanks
comment Posted October 9, 2008 Posted October 9, 2008 That's a whole new ball game. Do you mean find the formatted text within the field, or find records containing formatted text?
rsagall Posted October 9, 2008 Author Posted October 9, 2008 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
comment Posted October 9, 2008 Posted October 9, 2008 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.
Raybaudi Posted October 9, 2008 Posted October 9, 2008 Now I need to be able to find text that is formatted as "strikethough" and delete it. Hi try this file to have an idea... strikethough.zip
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now