Jump to content
Salesforce and other SMB Solutions are coming soon. ×

Change selected text color


Recommended Posts

Not necessarily a script. It can be done with a calculation field, or an auto-enter calculation into a text or number field. You need to look up FMP 7's text formatting functions.


I don't have a copy of FMP 7 ewith me at the moment so I can't be more specific...

Link to comment
Share on other sites

to set the color of all occurrences of a matched word:


set field[text 1, Substitute( text1 ; text2 ;TextColor( text2 ;RGB(0;0;255)))]


to set the color of a selected string wtihout resetting prior selections:


set field[text1, Replace( text1 ; Get(ActiveSelectionStart) ; Get(ActiveSelectionSize) ;TextColor(Middle( text1 ;Get(ActiveSelectionStart) ; get(ActiveSelectionSize));RGB(255;0;0))) ]


to set the color of a selected string after resetting prior selection:


set field[ Replace( TextColor(text1;RGB(0;0;0) ); Get(ActiveSelectionStart) ; Get(ActiveSelectionSize) ;TextColor(Middle(text1 ; Get(ActiveSelectionStart) ; Get(ActiveSelectionSize));

RGB(255;0;0))) ]


Vaughan, I couldn't get this to work as an auto- enter, even though i set to replace existing value, it only works first time round. What am I missing?



Link to comment
Share on other sites

I think you may need to trigger the Auto-enter by using sometthing like


If(Get(ActiveFieldName) = "text1";"Do your thing";text1)


Sorry about "Do your thing" but this is whatever calculation you want to perform on the field text1 it is NOT replace text1 by "Do your thing" smile.gif

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...

Important Information

Terms of Use