Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

timing a script

Featured Replies

Hi,

 

Is it possible to tell FM to execute a script very day at 3 PM?

Or a workaround to make that happen?

 

Cheers

 

Koen

Is it possible to tell FM to execute a script very day at 3 PM?

Or a workaround to make that happen?

 

It's not clear whether your question concerns a server or a desktop application.

 

Please update your profile to show your version and OS.

  • Author

It's not clear whether your question concerns a server or a desktop application.

 

Please update your profile to show your version and OS.

Sorry,

I'll have a go on my profile.

But the question is for a MacMini 10.8.x with FM Pro 12.

It runs as a little server. And my user machines have FM Pro Advanced.

 

What I want is that my server once a day runs a little script.

The server itself stays (as long as i'm not busy on the server itself) in the same view of the database.

The best way to do this, IMHO, is from the outside: use iCal (or chron) to schedule a daily event and set the event to open another FMP file (or run an AppleScript) to trigger your script. In case of another file, it only needs to run a startup script that calls the script in the "real" file and then closes itself.

 

To do it "from the inside" you would need to install an OnTimer script, both as part of the startup script and as part of the script being run; in each case you need to calculate the time remaining until 3:00 PM and set that as the interval. Note that the script is installed in that specific window only. If you close the window, you'll lose it.

Here is a quick link to your profile, MY PROFILE, please show your FileMaker version, platform and OS..

  • Author

The best way to do this, IMHO, is from the outside: use iCal (or chron) to schedule a daily event and set the event to open another FMP file (or run an AppleScript) to trigger your script. In case of another file, it only needs to run a startup script that calls the script in the "real" file and then closes itself.

 

To do it "from the inside" you would need to install an OnTimer script, both as part of the startup script and as part of the script being run; in each case you need to calculate the time remaining until 3:00 PM and set that as the interval. Note that the script is installed in that specific window only. If you close the window, you'll lose it.

And If I use the OnTimer script this way :

   If current time = 3PM then run script i have chosen

And I put the OnTimer script on a special layout for my little server. (as layout trigger)

 

Or is that an too easy thought

Here is a quick link to your profile, MY PROFILE, please show your FileMaker version, platform and OS..

Ok done so.

It is possible. Run the on timer script every hour checking for the time. Wrap your perform script in an If time =3:00

It is possible. Run the on timer script every hour checking for the time. Wrap your perform script in an If time =3:00

 

It's possible to run the OnTimer script every hour; it's not possible to run it every hour on the hour (unless you start it exactly on the hour - and even then it may drift away during the course of the day).

  • Author

It is possible. Run the on timer script every hour checking for the time. Wrap your perform script in an If time =3:00

But how do I run the timer script very hour?

If I can run the timer script very hour I can run any script very hour right?

And how do I do that?

When you set an on timer script you set hour many seconds are between each execution. So set the script timer for 3600 seconds and the script it calls very 3600 seconds checks for the time and if 3:00 continue.

  • Author

When you set an on timer script you set hour many seconds are between each execution. So set the script timer for 3600 seconds and the script it calls very 3600 seconds checks for the time and if 3:00 continue.

Ahh, that works!

But something else popped up.

To test I created 2 scripts

#1 the on time script - set to 15 seconds and the call script #2

#2 show custom dialog "test"

 

I also created 2 layouts.

The first one has a "onlayoutenter" to call #1

the second has no starting scripts.

 

When I'm at the 1st layout very 15 sec I get my dialog. So thats good

But when I switch to layout 2, #1 should stop working, but unfortunate it does not.

It continues popping the dialog very 15 sec.

How do I stop that?

They are tied to the window not the layout. If you want to stop the on timer script you set it again with an interval of blank using double quotation marks

  • Author

They are tied to the window not the layout. If you want to stop the on timer script you set it again with an interval of blank using double quotation marks

Thanks!!!

Think I have the answers I'm looking for now.

 

Cheers

 

Koen

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.