Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Retired professor

Featured Replies

  • Newbies

Is there a plugin which will enable me to assign a color to a container field by a script which uses RGB fields to set the color of the container?

I believe this can be done without requiring a plugin. Can you explain why you need this?

 

--
P.S. What's up with the title?

Edited by comment

Hi Guy,

comment is correct that you can accomplish this without any of our plugins. You can change the background color of a container by changing its Fill setting to a color under the appearance tab in the inspector panel. I don't believe there is a way to change the fill color in FileMaker using a script.

However, a workaround is to have the container's fill color be set to "None", and have some rectangle objects hidden behind that container that will show up with conditional formatting.

With our SuperContainer plugin, we do have an an option to change the background color of our SuperContainer. You can take a look at that option here in our documentation http://docs.360works.com/index.php/SuperContainer#Customizing_SuperContainer_Appearance.

This also may be accomplishable with our ScriptMaster plugin, which utilizes Groovy to execute Java code, but we do not have an example module that does what you're asking so you would have to figure out how to write the Groovy code for that. We do offer consulting for custom work if that's something you are interested in having developed for you.

37 minutes ago, nick360Works said:

have some rectangle objects hidden behind that container that will show up with conditional formatting.

You cannot use conditional formatting to change a color of an object to arbitrary RGB values.

 

38 minutes ago, nick360Works said:

I don't believe there is a way to change the fill color in FileMaker using a script.

But there is a way to change the color of the image shown in a container field, using a calculation. Still, if the purpose is to create a colored rectangle - e.g. to serve as a background - the simplest solution is to use text and color it using the TextColor() function which accepts RGB values as its input.

 

14 hours ago, comment said:

the simplest solution is to use text and color it using the TextColor() function which accepts RGB values as its input.

 

I thought that was an interesting option and looked into how to apply that. But Textcolor changes the color of the actual text in a field (or variable) not the background. Can you give an example how to color a background ( I assume a text object) using this?

20 hours ago, OlgerDiekstra said:

But Textcolor changes the color of the actual text in a field

Yes, that is the idea. Use a rectangle character, such as Char ( 61543 ) in Webding font, or Char ( 9632 ), and make the font size very large.

 

Edited by comment

Cool. Might come in handy sometime.

For those interested in this, here's code that will make this work:

Place a text object on a layout and give it the value <<$$BG>>, or whatever suits.

Use a script with the following code to control the color:

Set Variable [$$BG; Value: "g"]
Set Variable [$$BG; Value: TextFont( $$BG; "webdings" )]
Set Variable [$$BG; Value: TextSize( $$BG; 1000 )]
Set Variable [$$BG; Value: TextColor( $$BG; RGB( 128; 128; 128 ) )]
Refresh Window []

Size and color can now be set dynamically. These variables can of course be merged into one.

Char( 61543 ) that Comment used above is actually "g" in webding.

Edited by OlgerDiekstra

5 hours ago, OlgerDiekstra said:

Char( 61543 ) that Comment used above is actually "g" in webding.

Not exactly. "g" is actually Char ( 103 ). A long time ago, you could type "g" and format it as Webding font to get a rectangle. This stopped working on MacOS years ago, in all applications, including Filemaker. I have just now checked and it does work again in FMPA 17, but not in other applications. 

Ha, I don't have a Mac to play with. Windows only. But you have a point. Refreshing my memory (ie googling) learns that webdings, wingdings etc are not reliable on webpages, and probably also not across platforms. Unicode (which is what Char() produces) is (or supposed to be) reliable on webpages and across platforms. From what I've read, webdings and wingdings (the latter I knew) is geared towards Windows. Other plaforms may have implemented parts or the whole but there's no guarantee. In fact, Web/wingdings displays best in IE. That says enough really.

So we're best off to use Char( 61543 ).

Thanks Comment!

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.