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)
Enter some text in the Subject line and it becomes the Window Title.
FileMaker can do this as well.
Type some text in the Window Name field.
1) Define a simple script called something like “Set Window Name”
2) Use the Set Window Title function
Hint, it is in the Windows area of the Functions list when Viewed by Category
3) In the Options dialog click the Specify button.
4) Use an If Statement to assign a name if the field is empty
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.
Click on the field. Then right click to bring up a contextual menu. Select ‘Set Script Triggers’.
6) Set Script Triggers
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.
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.