Indicate Progress in FileMaker Go and 11

July 29, 2010

When I was preparing a sample file for the How To Prevent Support Calls video I wanted to make it as cool as possible, so I decided to optimize it for FileMaker Go. I quickly discovered that I need a plug-in free alternative for the progress dialog.

I wanted something nice looking while still as easy to implement as 24U SimpleDialog Plug-In. That really was the kind of challenge I like. I started getting ideas only to deny each of them in the very next second:
  • New window displaying a special “progress bar” layout – not good for Go, problem with maintaining script’s context.
  • Transparent web viewer in the front layer rendering CSS – too complicated to develop, may be hard to interact with objects behind the web viewer. I also thought that rendering HTML is a bit of overkill.
  • Collection of fields to display progress status and progress bar – the oldest approach, a little boring, and too difficult to copy across solutions.
Then I got this one which I implemented in the sample file: conditional formatting

In this implementation a single global text field displays the progress status, 10 text objects use conditional fill color to show the progress bar, 2 button objects use conditional fill color to serve as a dialog-like background and frame. To implement it into your solution you only need to copy one field, one group of layout objects and then update the progress field and refresh window from within your script. Fair enough, isn’t it? Well, not for me… ;-)
So I asked myself – can I make it even simpler? And I got another idea: merge variable

 

Then I created the final implementation:
  • No plug-ins
  • No fields
  • No dependency on the database schema
  • A single layout objects group to copy
  • No modifications necessary
  • Driven by a single global variable: $$progress
  • Works in FileMaker Pro 11 and FileMaker Go

And here it is for you to take and use for free:

(even directly to iPhone or iPad with FileMaker Go installed)

 

 

How do you like it?

{ 22 comments… read them below or add one }

Steve Wright July 29, 2010 at 11:02 pm

Pretty cool thanks, I was thinking of a good way to do this myself. Just dont try it on Windows :-P the refresh window step causes too much flicker. However on that note, inside the loop if you replace the refresh window[] step with :P ause/Resume [Duration (seconds): 0 ] Freeze Windowit refreshes itself without flicker.

Reply

Paul July 30, 2010 at 12:16 am

Very nice, HOnza. Unrelated question: How do you put round corners on a text box?

Reply

HOnza Koudelka July 30, 2010 at 3:03 am

Good poinr, Steve! Thanks. Paul, you’ve made me correct the article – check the difference ;-)

Reply

John Sindelar July 30, 2010 at 3:28 am

HOnza, Steve… brilliant.

Reply

Paul July 30, 2010 at 5:59 am

ahh… perfect. Thanks HOnza!

Reply

HOnza Koudelka July 30, 2010 at 7:21 am

John, thanks, praise from you counts twice ;-)

Reply

Fabrice Nordmann July 30, 2010 at 7:24 pm

Honza, I’ve learned a lot with this file and other readers’ comments. Thanks a lot for sharing this!

Reply

HOnza Koudelka July 30, 2010 at 10:12 pm

Thanks, Fabrice. I’m glad it helped you. Hope you’ll share when you improve it even more…

Reply

Beatrice Beaubien July 31, 2010 at 4:22 pm

Thanks HOnza, this is great!

Reply

Tim Cimbura August 18, 2010 at 4:44 pm

Great solution! Thanks for sharing it.

Reply

Denis Somar August 27, 2010 at 2:58 am

This is a great technique. When I open the indicate progress script on v11 on OS X 10.6, I see a lot of <function> insertions. Is there a component missing? The file still demos correctly though?

Reply

Denis Somar August 27, 2010 at 2:59 am

that last comment is supposed to say function MISSING insertions

Reply

HOnza Koudelka August 27, 2010 at 9:13 am

Thanks for the comments. I am glad you like the solution.To Denis: the script automatically uses 24U SimpleDialog Plug-In in FileMaker Pro when it is installed. If you don’t have SimpleDialog installed it will simply automatically use the plug-in free implementation.

Reply

Denis November 18, 2010 at 5:58 pm

Honza, is there a way to use this script that is not in a loop? Also, I’m curious as to why we need to relate the progress as a function of time (20 seconds in your example) when it should be according to progress made in the script, no?Thanks,Denis

Reply

HOnza Koudelka November 18, 2010 at 8:59 pm

Denis, the example uses the loop and the time function only as placeholders for real work you would be doing in your scripts.The key is when you want to advance the progress bar you have to do 2 things: update the $$progress variable, and refresh the window. That’s all. When you set the $$progress variable to an empty string and refresh the window the progress indicator disappears.Try to open the file in FileMaker Pro Advance, and try to set the $$progress variable to various values using the Data Viewer. You’ll see how it works.

Reply

Hal Gumbert May 9, 2011 at 7:00 am

Honza,

I use this all the time! I’ve even created Looping Scripts and the layout Objects in ScriptMaster that I can paste into my code quickly. Works great and is soooo simple!

Thanks, Hal

Reply

Andries Heylen July 19, 2011 at 4:29 am

hi Hal,

I am intrigued by this technique with ScriptMaster. Do you mean you create the XML structure of the layout objects, and simply place them into a container field?

Mark Cyrulik October 26, 2011 at 7:42 pm

Really well done! We are going to start implementing this in a lot of our solutions.

Reply

Charles Ross December 21, 2011 at 10:38 am

Thanks for the technique. I adapted it a bit so that I use a global field instead of text blocks, and thought you might be interested in the solution. Basically, I created a global field with 101 repetitions, all of which I display on the layout. The conditional formatting for the field is ( ( Get( CalculationRepetitionNumber ) – 1 ) / 100 ) ≤ $$INTERFACE.PROGRESSBAR1, which allows very granular progress indication and, should more become desired, increasing the repetitions and editing the conditional calc will do so. The global variable is designed to have a percentage value between 0 and 1.

Reply

HOnza December 29, 2011 at 1:44 am

Thanks for sharing your experience, Charles.

In my case I wanted to avoid using fields at all to make it easier to copy the progress bar as a single layout objects group and paste it into any other solution.

But I also like your idea of using a repeating field with conditional formatting. That’s a nice way to achieve better granularity without having too many objects on the layout. It’s also less work to implement from scratch.

Eric Twiname January 27, 2012 at 2:09 pm

HOnza,
Very nicely done…from the posts it looks like I’m late to the party, but appreciate your work just the same.

One thing I ran into when installing this method on a solution is that the representation on screen during use was displaced. I don’t see that in your demo file and wondered if you had run into it before.

When in layout mode, I’ll put the bottom right corner of the grouped MV’s at, say pixel 100,100.
In browse mode, when the progress bar graphic shows, the Top-Left corner is at pixel 100,100. Not quite sure why this happens…any thoughts?

Reply

HOnza January 27, 2012 at 2:34 pm

Eric, I think the reason is that there are no anchors set, so the progress indicator’s position is maintained as relative to the center of the layout.

Leave a Comment