July 13, 201312 yr Hi folks, I'm about to issue a time-limited script for a runtime demo. I need help compiling the script which will be along the lines of; At startup, check if the current date is less than August 30, 2013, if it is, then open the "Home" layout, else a custom dialogue "Demo period has expired" and the runtime closes. I should add that there is already an "OnLayoutEnter" short script, (I'm assuming this is what the script would be attached to, as it's the start layout). The script reads simply "Set Field [Client Search Global::gSearch; "Enter Search Text"]. I would assume the time-limiting script lines would be entered above this statement in the same script. Or is there another place I locate this script? I'm not well rehearsed with "If" scripts yet (not a lot of need for them in this, my first, solution). Thanks in advance.
July 13, 201312 yr Solution The script should be triggered by OnFirstWindowOpen (in File->File Options...->Script Triggers) If[Get(CurrentDate) < Date(8; 30; 2013)] Go to Layout["Home"] Set Field [Client Search Global::gSearch; "Enter Search Text"] Else Show Custom Dialog["Demo period has expired"] Exit Application End If
July 13, 201312 yr Author That's great. Thankyou. Just needed to get the expressions correct. The script should be triggered by OnFirstWindowOpen (in File->File Options...->Script Triggers) If[Get(CurrentDate) < Date(8; 30; 2013)] Go to Layout["Home"] Set Field [Client Search Global::gSearch; "Enter Search Text"] Else Show Custom Dialog["Demo period has expired"] Exit Application End If
July 13, 201312 yr Except of course that this process can be easily defeated by any number of mechanisms, including the rather obvious one of tinkering with the computer's clock. Or by interrupting the script. Steven
July 14, 201312 yr Author Except of course that this process can be easily defeated by any number of mechanisms, including the rather obvious one of tinkering with the computer's clock. Or by interrupting the script. Steven Thanks Steven, Yes I had thought of that. Fortunately the individuals it will be going to (whom I know personally) aren't that computer savvy to know a workaround like that (trust me, they really aren't!), and I'm still learning about FileMaker security. Speaking of which, is your book on the topic still available, and relevant to v12? (I noticed its unavailable on Amazon).
Create an account or sign in to comment