Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

Posted

Hello

I have a field that i would like to toggle the font color in. I made the field into a button and I used the following script to make the click turn the font from yellow to green and if it was already green to yellow.

If[TextColor ( colors::first ; RGB ( 255 ; 255 ; 0 ) ) //yellow

Insert Calculated result[select;TextColor ( Colors::first ; RGB ( 0 ; 255 ; 0 ) )//green

Else If[TextColor ( colors::first ; RGB ( 0 ; 255 ; 0 ) ) //green

Insert Calculated result[select;TextColor ( Colors::first ; RGB ( 255 ; 255 ; 0 ) )//yellow

end

But it doesn't do any toggleling when I click on the field as a button.

Can someone tell me how I can make the font color toggle this way?

Thanks

Dave

Posted (edited)

Thank you so much

I was looking for this answer all night long.

It means so much that you showed me how to do this

Dave

Also

I do have another concern because in my case I am actually trying to do this exactly with this toggling of the font color:

Example:

If the field "numbers" contains the word "One"

change the text color to purple rgb (150,0,255)

if it is already green.

But if it is text color is yellow already and the field "numbers " contains the word "one" - i would need the

change the color to red.

and put the amount of 1 in a field "counted"

This is because I want to be able to track all the red text and tabulate it with a running tabulation and maybe more later.

So I still need help when the color has become yellow on how to further change the color to red and add the instance as part of a running total. I am making an example file.

toggle_font_color.fp7.zip

Edited by Guest
Posted

HI Danielle,

I am somehow unable to download the file. There is an error message which says the file does not exist.

I don't know what that means

I am anxious to receive the file but it says it is not there

Dave

Posted

Confirmed.

I'm wondering, because it Saturday, that this isn't a Site problem. I will report it to Stephen.

Lee

Posted (edited)

Thanks

Dave

ACTUALLY

In my example I am looking to change the font color from green to purple if it is originally green and yellow to red it if is originally yellow.

Edited by Guest
Posted

The file you just attached is available, but the one that Soren attached earlier, needs to be re-uploaded.

Lee

Posted

BTW:

1) make the field "font color" a calculation field and calc:

Case(

random number = "One" and PatternCount ( GetAsCSS ( Self ) ; "00FF00" ) ;TextColor ( random number ; RGB ( 150 ; 0 ; 255 ) );

random number = "One" and PatternCount ( GetAsCSS ( Self ) ; "FFFF00" ) ;TextColor ( random number ; RGB ( 255 ; 0 ; 0 ) );

random number = "Two" ; TextColor ( random number ; RGB ( 255 ; 255 ; 0 ) );//yellow

random number = "Three" ; TextColor ( random number ; RGB ( 0 ; 255 ; 0 ) )//green

)

2) make the field "number" a calculation field and calc:

PatternCount ( GetAsCSS ( fontColor ) ; "FF0000" )

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