1 Reply Latest reply on Dec 1, 2013 8:42 PM by philmodjunk

    Format Selected Text

    dbail22@comcast.net

      Title

      Format Selected Text

      Post

           I have a text field that usually contains several hundred words.  I would like the user to be able to format selected words simply by click on them and not click drag and select a color.

           I can get the proper desired selection of a word using a script but I cannot figure out how to then re-color the selected word within the field.  Any ideas?

        • 1. Re: Format Selected Text
          philmodjunk

               Presumably your script determines the start and end of the clicked word. (that's how I do it anyway...) If so, then you can use textformatting functions to apply a text format to just the clicked word in an expression such as this example that changes the style to Bold:

               Left ( TextField ; $Start - 1 ) & TextstyleAdd ( Middle ( TextField ; $Start ; $End - $Start + 1 ) ; bold ) & Right ( TextField ; Length ( TextField ) - $End )