Koen Posted January 8, 2014 Posted January 8, 2014 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
comment Posted January 8, 2014 Posted January 8, 2014 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.
Koen Posted January 11, 2014 Author Posted January 11, 2014 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.
comment Posted January 11, 2014 Posted January 11, 2014 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.
Lee Smith Posted January 12, 2014 Posted January 12, 2014 Here is a quick link to your profile, MY PROFILE, please show your FileMaker version, platform and OS..
Koen Posted January 12, 2014 Author Posted January 12, 2014 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.
comment Posted January 12, 2014 Posted January 12, 2014 And If I use the OnTimer script this way : If current time = 3PM then run script i have chosen Alas, that's not possible: http://www.filemaker.com/13help/en/html/scripts_ref1.36.18.html#1044171
Brooks Posted January 12, 2014 Posted January 12, 2014 It is possible. Run the on timer script every hour checking for the time. Wrap your perform script in an If time =3:00
comment Posted January 12, 2014 Posted January 12, 2014 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).
Koen Posted January 12, 2014 Author Posted January 12, 2014 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?
Brooks Posted January 12, 2014 Posted January 12, 2014 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.
Koen Posted January 12, 2014 Author Posted January 12, 2014 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?
Brooks Posted January 12, 2014 Posted January 12, 2014 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
Koen Posted January 12, 2014 Author Posted January 12, 2014 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
Recommended Posts
This topic is 3967 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 accountSign in
Already have an account? Sign in here.
Sign In Now