Changing Window Names based on User Input


Sometimes you notice the little things in a software program and wonder ‘How did they do that?’. As a FileMaker Developer, the next question is usually, ‘can I do that in FileMaker?’ Today I was noticing that in Apple’s Mail App, when you start typing something in the Subject field of a message, it shows up in the Window Title. A little thought and experimentation suggests that you can achieve much the same effect using FileMaker 10 or 11. This ability might be useful in giving users feedback when filling in forms, emails or other correspondence. It gives subtle feedback that something is being effected and their data entry is not in vain.

Blank Subject field in Apple Mail – Note: (No Subject)

wpid1267-media_1325892545496.png

Enter some text in the Subject line and it becomes the Window Title.

wpid1268-media_1325892564007.png

FileMaker can do this as well.

wpid1274-media_1325892863151.png

Type some text in the Window Name field.

wpid1269-media_1325892589765.png

1) Define a simple script called something like “Set Window Name”

wpid1273-media_1325892624762.png

2) Use the Set Window Title function

wpid1277-media_1325893406297.png

Hint, it is in the Windows area of the Functions list when Viewed by Category

3) In the Options dialog click the Specify button.

wpid1275-media_1325893046337.png

4) Use an If Statement to assign a name if the field is empty

wpid1276-media_1325893069364.png

The calculation I employed is this: If(IsEmpty(Window Test::Window Name); “(No Subject)”; Window Test::Window Name). You may need to edit this if your field and table names are different. You can also change “(No Subject)” to whatever is appropriate, or leave this blank.

5) Next apply a script trigger to the field.

wpid1270-media_1325892602833.png

Click on the field. Then right click to bring up a contextual menu. Select ‘Set Script Triggers’.

6) Set Script Triggers

wpid1271-media_1325892609969.png

Right click on the field to bring up a contextual menu that allows you to Set Script Triggers.

7) Use the OnObjectModify to assign a script trigger to perform the “Set Window Name” script.

wpid1272-media_1325892615718.png

You could use OnObjectExit if you only wanted the Window Name to change when the user had completed their data entry (and exited the field), but it seems more meaningful when the change happens immediately.

Related Articles:
Windows Management Part I: Cleaning up Windows in FileMaker
Windows Management Part II: How to stop the user from accidentally closing the last window in a FileMaker database

4 Responses to “Changing Window Names based on User Input”

  1. Good idea!
    Thank you.

Trackbacks/Pingbacks

  1. Windows Management Part II: How to stop the user from accidentally closing the last window in a FileMaker database | HomeBase Software - July 13, 2012

    […] Articles: Windows Management Part I: Cleaning up Windows in FileMaker Changing Window Names based on User Input Share this:EmailTwitterFacebookPrintStumbleUponRedditLinkedInDiggLike this:LikeBe the first to […]

  2. Windows Management Part I: Cleaning up Windows in FileMaker | HomeBase Software - July 13, 2012

    […] Related Articles: Windows Management Part II: How to stop the user from accidentally closing the last window in a FileMaker database Changing Window Names based on User Input […]

  3. 99 Bottles of Beer – in FileMaker 11 | HomeBase Software - July 14, 2012

    […] Articles: Where Am I? Using FileMaker Go 12 to track your Location Changing Window Names based on User Input FileMaker Progress Indicators using a Web Viewer […]