Jump to content
Server Maintenance This Week. ×

Tracking Elapsed Time Dynamically


This topic is 6563 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I have a database that assigns tasks and monitors status of work orders in my cabinet shop.

The main screen signals if a worker is engaged in an activity by conditionally highlighting a container field behind the worker name. I also have a timestamp field that lets us know what time this task was started.

What I would like to do is keep track of how long this activity has been in process. What I need, I guess, is some kind of timestamp that constantly refreshes itself. Subtracting the start-up timestamp from this dynamic one would probably give me the answer that I want.

[color:red]Does anybody have any ideas of how to continuously (periodically?) refresh a timestamp field?

Thanks,

Jarvis

Link to comment
Share on other sites

By timestamp field, i assume you're referring to an unstored calculation with get(currenttimestamp) as the calculation. An unstored calculation however will refresh only when the screen refreshes. You may opt to have a "Refresh" button that a user pushes to see the current status of things. It's the only way i can see of doing it really.

~Genx

Link to comment
Share on other sites

You know what, on second thoughts, you could do something. You could make it refresh every 2 minutes with a simple looping script.

I.e.

Loop

Refresh Window[Fluch Cached Join Results]

Pause/Resume [120]

End Loop

Then, on all other buttons leading away from that page, or executing another script, choose "Halt" to be the action to be taken on the "Current Script" in the button setup dialog that pops up when you double click a button.

This will cancel the script when you goto press one of these other buttons(otherwise it will keep looping in another part of the database where you don't want the page to be looping like that because the default is pause as far as i remember).

Anywho, just an idea.

You may not see flickering when your window is refreshed seeing as your on MAC OS, (it goes crazy on windows) so you might reduce the refresh down to a minute perhaps.. or if you desperate 30 seconds. But remember that the data has to be reloaded and calcs refreshed each time you refresh the window.

~Genx

Link to comment
Share on other sites

The trouble with a Looping scipt is, as Genx says, it's a pain to do anything else while it's running. Another possibility, on Mac, is to use the AppleScript idle command. It is designed to just sit there, using almost no processing power, doing whatever you tell it over and over at whatever time interval you set up. It must be a little stand-alone, stay open* application (applet).

Its one downside is that it appears in the Dock. I believe that can be suppressed somehow, but not easily.

What I've done in the example file is to tell it to run a FileMaker script. The script just sets the beginning time to itself, which causes the elapsed time to recalculate.

You have to do something to stop errors from occurring, when you first start the idle app (it calls FileMaker immediately, and this causes an error, since FileMaker is still in the script). I used "ignoring application responses" for that.

And also when it calls the FileMaker script, I used "try" to suppress any error. That way you can do whatever in FileMaker, and the idle will not error. It will just try again later.

I've set it up for 10 seconds, so you can see it happen. Probably 1 minute would be better.

Hopefully it will be able to launch on your computer. I calculated the file path, but it doesn't seem to be needed.

Timer_wAS_Idle.zip

Link to comment
Share on other sites

Genx & Fenton,

Thanks for both of your input.

I've never experimented with looping or applescript.

The applescript has been on my list for a long time but like so many other things, not high enough on that list.

Most of my day is spent running my cabinetshop.

I am not a programmer by profession as many of the people on this forum seem to be. Nonetheless I sure glean a lot from you guys and I am very grateful for your responses.

Jarvis

Link to comment
Share on other sites

This topic is 6563 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.