4 Replies Latest reply on Jun 20, 2017 8:59 AM by Jaymo

    Color Button script

    drada

      Hello FM Community,

       

      Having a field set for Notes, I need to create a button that change to red color the text content (within the field) I highlight.

      Note: Not all the content, just the one I highlight. Any ideas for a script having this functionality? I tried different scripts all it does is turn the whole field content to red.

       

      Thanks!

       

      Daniel

        • 1. Re: Color Button script
          Jaymo

          Set Variable [$Selection; Value: Get(ActiveSelectionStart) & " " & Get(ActiveSelectionSize)]

           

          Insert Calculated Result [TextColor(Middle(GetField(Get(ActiveFieldTableName) & "::" & Get(ActiveFieldName)); Get(ActiveSelectionStart); Get(ActiveSelectionSize));RGB(255; 0; 0))]

           

          Set Selection [Start Position: LeftWords($Selection; 1); End Position: LeftWords($Selection; 1) + RightWords($Selection; 1) - 1]

          2 of 2 people found this helpful
          • 2. Re: Color Button script
            bigtom

            Jaymo wrote:

             

            Set Variable [$Selection; Value: Get(ActiveSelectionStart) & " " & Get(ActiveSelectionSize)]

             

            Insert Calculated Result [TextColor(Middle(GetField(Get(ActiveFieldTableName) & "::" & Get(ActiveFieldName)); Get(ActiveSelectionStart); Get(ActiveSelectionSize));RGB(255; 0; 0))]

             

            Set Selection [Start Position: LeftWords($Selection; 1); End Position: LeftWords($Selection; 1) + RightWords($Selection; 1) - 1]

            Nice. A web viewer is also a cumbersome option.

            1 of 1 people found this helpful
            • 3. Re: Color Button script
              drada

              Thank you so much Jaymo!. it works like a charm!

              • 4. Re: Color Button script
                Jaymo

                You are most welcome. Happy FileMaking!