When you're working in other FileMaker windows, are you running scripts? If you start a script, FM will wait until it finishes to start the OnTimer script.
No, no other scripts are running while i’m debugging this issue.
OnTimer script will run even when they are not the front most window, but they won't update like you want them too. Only the front most window that you have active can be updated.
So, Rudy, the question is, when you bring the window forward again, is the time correct?
If so, the issue is simply that that 'clock' doesn't display the incrementing time in the background. That's a window refresh issue.
i’m sorry, that makes no sense, either OnTimer runs in the background or not.
if i understand the documentation correctly, it runs as long no other scripts or menus are active.
but it does not.
It is running. If you do any other script, that script have to finish before your OnTimer script can run again. Say you have to OnTimer script running in intervall, whenever they crash, the other have to wait for the other to finish first.
I window that is not front most want update
no, that is the problem. OnTimer really goes to sleep. It does not increment my clock_timer field.
when i return to the timed window, it’s “behind” the system clock. ie the system clock advanced 20 minutes and OnTimer only advanced 2 minutes.
so OnTimer did not stop completely. it went into slow motion of a few seconds per minute.
even a single OnTimer will go to sleep. i’m not running ANY other scripts.
typically i will be working in other programs and when i come back to Filemaker, the OnTimer is way behind.
Isn´t that because you have run other scripts? If you have Script Debugger On dont you see that your OnTimer is running?
Perhaps use Get (CurrentTime) instead. When your window is refreshed it should bring in the current time.
•If a script is running, any scripts associated with timers will not run until the script that is running finishes.
•If the active window has an installed timer and the user or a script opens a new window, the new window inherits the timer.
•Each window can have a separate timer operating at the same time. Timers continue to run even if windows are in the background or hidden. If you’re using dialog windows and timers, see About window styles.
•To run scripts on a schedule and independently of open windows, see .
It was more clear in FM13 help, says
Runs a specified script at the specified interval. Installs a timer on the active window. After the specified interval has passed, the next time the application is idle, runs the specified script.
In some situations FM thinks it is not idle, then the installed timer script not run immediately.
Most clear case is when you are opening menu item or any dialog.
my stopwatch is more a time counter than a clock. i can pause and continue it.
i track the time spent on an activity.
i don’t just display the current time.
i know that being in a menu takes Filemaker out of its idle state and will then interrupt the timer.
but that is not the situation here.
here we have the simplest situation a timer can be in :
1) one open window with a timer set to 1 second interval
2) no scripts are running
3) no menu is open
4) no dialog is open
5) running on a standalone machine
6) nothing else is being done in Filemaker
but the moment the window is in the background, Filemaker fails to call the timer script every second and after a while it fails most of the time.
what could Filemaker possibly be busy with if it isn’t being used in any way?
"In some situations FM thinks it is not idle, then the installed timer script not run immediately."