Want a cheap and cheerful progress bar for your FileMaker looping scripts? How about something that doesn’t require a web viewer or refresh window step? Enter the handy Set Window Title script step... This isn’t the newest trick around but that doesn’t make it obsolete and since FileMaker 12 allows dialogue windows where we can hide the FileMaker footer bar, it’s got a new lease of life - enjoy!
How do we go about it then?
1. You’ll need to add a variable to your script at a suitable location and by suitable location I mean somewhere inside the loop. The variable is going to act as your progress counter so don’t forget to give the variable a useful name such as
2. The variable will need to be incremented each time it is set eg.
Set Variable [ $ProgressCounter; Value: $ProgressCounter + 1 ]
3. Just after the the Set Variable step, use the Set Window Title script step to set the current window to have an appropriate title, such as “Processing record X of Y” (where X is your
$ProgressCounter variable and Y is some other value, perhaps the original Found Count for the loop).
Now when your script runs, as long as you keep the window where the looping action is taking place on screen, you’ll have a nice clear progress counter.
1. To tidy this up even further, the window where the action is going on should be based on a layout where there's only a body part which has been shrunk to nothing and use Show / Hide Toolbars [Hide] and Adjust Window [Resize to fit] script steps so that the window shrinks.
2. Also if you’re using FileMaker 12 then consider using a Dialogue Window (Modal) window (tick the Specify Advanced Style checkbox in the New Window dialogue and select Dialogue Window). A word of caution! It’s easy to lock yourself out of your database, so to speak, with Modal Windows so make sure that you include a get out (such as a Close Window step once the script finishes) and only ever test the script when ending up in a permanent loop isn’t going to cause anyone any problems.
3. If a counter isn’t appropriate, then how about changing the title to something like “Processing.” then “Processing.. ”then “Processing...” then “Processing....” etc. Honestly, the mind boggles at what you can do here!
4. Obviously I wouldn’t recommend this in a FileMaker Go environment but then if you’re running a long looping FileMaker script on your iPad or iPhone you may want to consider a server side script instead.
No, it’s not really pretty like a web viewer progress bar or a clever set of global fields with fill changes based on conditional formatting, but it can be easily applied to most situations without much code - a quick and easy fix where something more complex is just overkill.
If you notice anything wrong with this blog, think that you can do it better or just want to discuss it, then please get in touch.