I was hoping for the same possibility natively in Filemaker, but haven't found any so far.
Most if not all progress bars are 100% divided in steps where the amount of steps defines the precision.
To get the most accurate progress you'd need to know when the process started ( that's easy ) and when exactly it will finish.
I don't think it's possible to predict when record sorting will complete, or many such processes.
You could benchmark it, then approximate it to go to like 90% then jump to 100 when done.
The way I've done this is for a startup script is to divide the process into chunks of code, milestones if you like.
The total to complete is divided by the number of the code chunks and whenever a chunk is completed I update the progress bar.
I went with the idea that progress doesn't need to be that accurate, they just give users feedback so they see that the system is doing something, instead of hanging up.
BTW, The animated gif is freaking broken on FM13 in Yosemite!!! Doesn't even work in the web-viewer anymore.
So no "spinner" this time either.
If you look at the OS progress bars they are usually quite inaccurate - they tend to go faster at the beginning. I think the main use of the progress bar is to give a user feedback what something is going on, plus some rough idea how much left to do.
I saw an implementation using a repeated field with 100 repetitions where you set a repetition to an image.
My current favourite is V3 FileMaker Pro Progress Bar by Andy Persons - need FileMaker 13.
Haven't used an animated gif in a while, but just tested on Yosemite/FMP13 and you are correct. I see the image of the spinner gif in the web viewer, but it isn't animated. If I open the gif with Safari, it works fine. Not the end of the world, but a pain the butt for sure. My guess is a tightening of security around using the local URL "data:text/html" specifier in Yosemite.
Any ideas of a workaround? I tried generating a brand new animated gif, but no difference.
We have moved to using animated HTML/CSS "spinners" - they work in Mac OS and iOS… but not in Windows, because it is using IE for that, and apparently it isn't compliant. So use conditional hiding to have an animated .gif for Windows, and CSS for modern browsers/OS.
Another option to add to your arsenal:
But as stated, there is no way to natively have FileMaker guess at how long something is going to take. The closest you can get is with some process that operates on a loop, figuring out the number of iterations, then basing your progress bar on the percentage of completed iterations. For cases where you don't have a loop or other way to break up the processing into logical chunks, an infinite loop animation/spinner/barber pole, just to let the user know that there is something going on.
Sounds interesting. I was wondering about CSS. Can you point me to some resources you use for CSS spinners or if you have any type of example file, it would be much appreciated.
Honestly, just do a Google search for "CSS spinners" and you'll get a bunch of sites with examples.
Here are the some examples from doing the search. Just copy the code and put it in a web viewer.
The only limitation that we have run into is that it seems to be impossible to make a web viewer transparent. So, you just have to have it on a flat background color and set the background color in the CSS to the same value. Also, there tends to be a white "flash" in the web viewer box while it loads. So if you background isn't white, you'll see the bounds of your web viewer briefly before the CSS loads.
An easy and effective way to do a progress bar is with a repeating field and conditional formatting controlled by a global variable, so as the global variable increases so the repeats in the "progress bar" change color and progress is displayed to the user.
Calls to a script that increases the Gvar each time can then be placed in different places in the process.
This is fast and looks consistent with other things in OS X - it also shows progress from a - to - b as opposed to merely indicating activity - if you set it up with the correct values.
dsApp_progressBar.png 25.3 K
I made my own progress bar using two custom functions:
Repeat ( Text , Number ) = If (number > 0 ; Text & If ( number > 1 ; Repeat ( Text ; number - 1) ; "") ; "" )
It will repeat what you pass as Text a Number times.
The other one is:
Bars ( CurrentValue , MaxValue , Barcount ) = Case ( CurrentValue > 0 and MaxValue > 0 and CurrentValue ≤ MaxValue ; Repeat ( "I" ; ( CurrentValue / MaxValue ) * BarCount ) )
I'm using the pipe character as the bar but you can use whatever you want. The biggest benefit of this fuction is that it is 100% text based so the overhead is minimal.
If you have a long script, you can update this bar on every important step so the user will know what is going on all the time.
Hope you like it.
you can also do a progress bar using the web viewer. I believe there are some examples over there!
I knocked together a CF that will give you an ETA, this can be used in conjunction with any aforementioned progress bar technique. You need 3 values, The start time of the task, the current iteration being processed, and the total number of iterations. The output is the estimated time the task will be completed. Please note that this cannot be used for native Filemaker sorting but is handy when looping through records, especially in large datasets.
CF Name : ETA
ct = Get(CurrentTime);
elapsed = Time(Hour(ct);Minute(ct);Seconds(ct)) - Time(Hour(starttime);Minute(starttime);Seconds(starttime));
speed = elapsed / Current;
remainrecords = Oftotal - current;
remaintime =Get ( CurrentTime ) + GetAsTime(speed * remainrecords)
Progress bars are meant to drive people to distraction when based on time. Anything occuring over the Internet is subject to the vagaries of Internet traffic which is why we get such wierd numbers when downloading Apple updates.
I personally would prefer giving an indication of how many steps are left in the script rather than any innacurate estimate of time. And it is quite easy to build in a counter inside a loop and if you want to incorporate that into a visual indicator graphic or alpha-numeric.
Note that the counter will affect the speed just as a thermometer affects the temperature of the water.
Step: xxxx of yyyy
Loop: xxxx of zzz
$_OuterLoop = $_outerLoop + 1
$_InnerLoop = $_InnerLoop + 1