Jump 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.

Scheduled script no server, my solution

Featured Replies

I might be reviving an old topic, but wanted to share what I have come with to run a script at a specified time of day. I have no Filemaker Server, I am running Filemaker Pro Advanced 11.

In my example I want to run script "Export_DL4_Call" at 23:00:00 every day which exports data from file, let's call it "File1".  I created another file, let's call it File2 on which I calculate the schedule of time and from it I call the script on File1.

At first I tried with windows scheduler but it was not reliable at all.

On File2 create fields "Time1" and "Schedule_Time" both as text. Create a script "Schedule_Time_24h" which runs every 24h with following steps:

Set Field [File2::Schedule_Time; 86400]

Install OnTimer Script ["Export_DL4_Call"; Interval: File2::Schedule_Time]

This will obviously run the script every 24h, but if the file opens at 7:00 then it will run it every day at 7:00, so I created a second script as follows

Create a script, which runs when file is open, "Schedule_at_23" with these steps:

Set Field [File2::Schedule_Time; ""]

Set Field [File2::Time1; Get ( CurrentTimeStamp )]

Set Field [File2::Schedule_Time; Let ( [ hour2 = 23; min2 = 0; sec2 = 0; hour1 = Hour (File2::Time1); min1 = Minute (File2::Time1);
sec1 = Seconds (File2::Time1) ]; ( sec2-sec1 ) + ( min2 -min1 )*60 + ( hour2 - hour1)*3600 )]

Pause/Resume Script [duration (seconds): File2::Schedule_Time

Perform Script ["Schedule_Time_24h"]

The reason I am running these scripts on a second file, is because Install OnTimer Script will stop if the windows from which it runs closes, so to avoid that, I am running it on a different file which is not accessible to users.

Edited by Toni
correction

  • Author

After some testing, I came with a better way because that Pause/Resume step of script is really annoying.
Posting here only the script steps:

"Schedule_Time_24h" steps:

Install OnTimer Script []

Perform Script [Export_DL4_Call]

Set Field [File2::Schedule_Time; 86400]

Install OnTimer Script ["Export_DL4_Call"; Interval: File2::Schedule_Time]

"Schedule_23_h" steps:

Select Window [Current Window]

Adjust Window [Hide]

Set Field [File2::Schedule_Time; ""]

Set Field [File2::Time1; Get ( CurrentTimeStamp )]

Set Field [File2::Schedule_Time; Let ( [ hour2 = 23; min2 = 0; sec2 = 0; hour1 = Hour (File2::Time1); min1 = Minute (File2::Time1);
sec1 = Seconds (File2::Time1) ]; ( sec2-sec1 ) + ( min2 -min1 )*60 + ( hour2 - hour1)*3600 )]

Install OnTimer Script ["Schedule_Time_24h"; Interval: File2::Schedule_Time]

Create an account or sign in to comment

Important Information

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

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.