janedoe Posted December 17, 2007 Posted December 17, 2007 hi, at the moment we are using eventscript to call a script in a file. this works really well, except when we want to run a number of script steps after the called script has completed - filemaker moves on before the called script has completed. this is pretty much it: set variable "abc" S4HU_EventScript ( $_CurrentFile; $_ScriptName ) set field... set field... set field... so, it will execute the script identified in $_ScriptName, in the file identified in $_CurrentFile, but FileMaker will move onto the Set Fields before it has finished executing the steps in the Script. is there a different way of using EventScript so that it completes the called script before moving onto the next script step? or, is there another plugin that we can use which will call a given script in a given file? tia, jd.
Fenton Posted December 17, 2007 Posted December 17, 2007 You could have the script that EventScript calls call back to a local script to do the Set Fields. It's an interesting question. I wonder if a Commit Records step just afterwards would pass control to the EventScript script and solve the problem? I don't know how that affects a Variable however; maybe it needs to be a global field than triggers it instead?
comment Posted December 17, 2007 Posted December 17, 2007 Hm, an interesting idea - using a plugin to select a sub-script by calculation. I don't think it can work your way, though. The main script has no reason to stop, since all it's doing is setting a variable. Meanwhile the plugin has placed another script in the stack - but since the current script is not paused, the execution order is unaffected. However, it gives me a rather crazy idea. Suppose the main script were somehow paused, you could then run your sub-script and have it resume the main script when it's done. You would need to use a plugin that has a "control" parameter, such as DoScript or zippScript, but I think it could work. (testing...) I have posted a demo file that shows how it can be done here: http://fmforums.com/forum/showtopic.php?tid/192021/
fabriceN Posted December 17, 2007 Posted December 17, 2007 The problem since FileMaker 8 (not 7 I think) is that a plug-in triggered script is put ta the bottom of the stack, unlike a standard Perform script action. The control options of DoScript and zippScript is not a work around : You'll have to split you main script. I wonder if this is not an issue that would explain why FMI still did not implement script triggerring in its products.
comment Posted December 17, 2007 Posted December 17, 2007 The demo I have posted shows 0 downloads at this time.
fabriceN Posted December 17, 2007 Posted December 17, 2007 Wow ! Comment, you did it ! Very, very neat. Been trying to solve this for months. Awesome !
janedoe Posted December 17, 2007 Author Posted December 17, 2007 hello, thank you so much - this looks very much like it will do the trick. we are going to try this out in our file ASAP and will post the results. jd.
Recommended Posts
This topic is 6535 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