brian rich Posted September 18, 2009 Posted September 18, 2009 I'm working in Filemaker 9, so can't use the OnRecordLoad trigger in FMP10. I'd like to use Scriptmaster's Call Script Immediately module to run a script when a record loads, (so I can select a particular tab on a tab object depending on a field value on the record) I can't see where to define the appropriate event condition for the Call Script Immediately module. Am I missing something or is it not possible to select the event that you want the script to trigger on? Thanks Brian
Valentin Posted September 19, 2009 Posted September 19, 2009 Well your only option within the ScriptMaster modules is to specify the script to execute. To execute the script during the desired "event" you would need to execute the ScriptMaster function when that event occurs. I think you should be able to use an unstored calculation, make sure that you have the calc on the layout with your tab control. But I'm not sure how reliably this would work.
brian rich Posted September 20, 2009 Author Posted September 20, 2009 (edited) On your website, it describes Call Script Immediately as: "This immediately calls a FileMaker script (scriptName) in the current file. You can use this to trigger scripts when field values change, when a tooltip is displayed, or any other time that FileMaker evaluates something in the calculation engine." This suggests that the script triggers on any event when Filemaker evaluates anything in the calculation engine and therefore I can't choose a particular event. So if I were on a layout where I first clicked on a Tooltip, and then I changed a field value, the script called by Call Script Immediate would trigger twice. Is this correct, or is there a way of choosing just one of these events to trigger on? In the meantime, I'll try and see if I can set up an unstored calc that will do the trick. Thanks Edited September 20, 2009 by Guest
andries Posted September 21, 2009 Posted September 21, 2009 You will have to investigate a way to do this... and it will not be easy. To trigger the script, you don't need an unstored Calc, but you can place the calculation simply in a webviewer. The problem is that a webviewer is evaluated all the time ( if you enter a field, exit a field, if you click etc etc )... So you will need to have something like this Let ( _script = "TriggerScript ( "TestScript" )" ; Case ( //find a way to see if a record is loaded ; Evaluate ( _script ) ; "" ) //End Case ) //End Let
dansmith65 Posted September 25, 2009 Posted September 25, 2009 Check out these links for some more information on triggering scripts via a calculation: http://www.softs4humans.com/FMPro_Plugins.html http://www.myfmbutler.com/index.lasso?p=416 My point isn't to show you other plug-ins to use, but to show you the documentation that comes with those plug-ins. If you download the example files, they show you all the ways of running a script from a calculation.
Recommended Posts
This topic is 5550 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