Try putting the Commit Record step in the loop just before the Goto Record next step. The catch to this is it will probably slow the process down considerably.
Thannks Bruce, but alas, that did not work. You were right about the increase in time, though.
What about a:
Pause/Resume Script [ Duration (seconds): .1 ]
Well here is something to try. Put a text object on or next to the picture set to be "clear" so it doesn't show. You will need to put a couple of space characters in it. Give it a conditional format that sets the back ground color with the formula mod[$counter;2] = 0
This will change the background color on the text object everytime $counter is an even number. If it works, it should produce the flicker you are looking for. Since there is no text other then the spaces in the text object, it should be invisible when the script isn't running.
You may have to put the refresh Window step back in, but should be able to take out the Commit record.
Haven't tried this, but it may be worth trying.
As a test I tried this in a test file and found two things.
First it works, but instead of the formula being mod[$counter;2] = 0 make it mod[$counter;2] = 1. With a 0 the formula evaluates true even when the script isn't running.
Second, adding the refresh window step greatly slows down the script. As a test, I set up loop that ran to a 1000. The Exit Loop If statement did all the work.
Exit Loop if[
$loopcounter = $Loopcounter + 1;
$loopcounter > 1000 )]
With out the Refresh window step, the script completed in less then a second. Under these conditions you didn't see the flicker. When I add the refresh window step the script ran long enough that I got bored and killed it, but you did see the flicker.
So my recommendation is to come up with another way of showing that the script is running. For instance, you could pop up a window with a message "Importing images" To do this, Add the following to your script.
Set Variable [$windowcurrent; get[windowname]
New Window[Message; Top: -10000] // opens off screen so you can set the layout and size
Go to Layout["Message" ]
Move/Resize window[Current Window; Top: XXX ; Left: XXX;...]
# Make sure the window is to the side of the working window so it is visible when the loop is running
# Your current loop with out the screen flicker stuff...
# rest of script
You can play with this and come up with he best position for the message window. It will show the message, but won't slow things down with refresh window or commit record steps.
Ray, this works. It does have a slow-down effect (no surprise there) on the execution speed. I have shown it to my boss and he did not like that. See my final response to Bruce for my next step.
Do I need to give you credit or something for your answer?
Bruce, thanks for the great reasearch! That was above and beyond the call.
Actually, as mentioned in my response to Ray, my boss saw his solution (Pause/Resume Script...) and said that the speed was too slow, so he asked me to look for another solution as well. It just so happened that I stumbled upon a potential alternate solution in Dr. Cologon's book, "Filemaker Pro 10 Bible" (see pp. 394-396). In it he discusses how a progress dialog may be displayed/updated, and he also gives a goodly amount of the code needed for implementation (thanks, Dr. Cologon!). If that method is faster, we'll be using it instead.
Thanks to the both of you for helping me out.