Page 1 of 1
Call script by name determined by calc
Posted:
Wed May 24, 2006 4:16 pm
by Nate
I want to simplify a lot of long case scripting, by having a script call to perform another script based on a script name being in a field.
Example:
(this is for a process checklist)
Portal whose records include fields "NextStep" and "NextStepScript".
Portal rows each have a button.
When pressed, the field "NextStep" would determine if the script would just mark the portal row "complete" and be done, or if it would mark it complete and then run another script. If the first field told the script to mark complete and then "run another script", it would look to the NextStepScript field to determine which script to run.
I can't find a way to call out scripts by name in a calc.
?
Re: Call script by name determined by calc
Posted:
Wed May 24, 2006 4:34 pm
by John Sindelar
Nate wrote:I want to simplify a lot of long case scripting, by having a script call to perform another script based on a script name being in a field.
<snip>
I can't find a way to call out scripts by name in a calc.
Neither can I.
There are plugins that will run a script by scriptname, however, including the FM Example plugin that comes with FileMaker Advanced.
Plug in
Posted:
Wed May 24, 2006 6:23 pm
by Nate
I have Advanced, but not sure what "included" plug in you're talking about...
Where do I find that bad boy?
I assume there is a specific function that does this...what is the name?
N8
Posted:
Wed May 24, 2006 7:29 pm
by John Sindelar
It's in...
FileMaker Pro 8 Advanced / Plugin Examples / FMI
...I'm not sure if you have to grab that from the CD or if it installs with the ap. The command you're looking for is:
XMpl_StartScript( filename; scriptname )
Nice!
Posted:
Thu May 25, 2006 9:18 am
by Nate
SWEET SWEET SWEET
I had to grab it off my disk...thanks, John.
That is going to be SUCH a useful tool, and save so much programming time by allowing the end user to manipulate what scripts get triggered based on layman term value lists (with scripts named the same, obviously).
Now, the only thing that would make this even sweeter is if you could have a Value List that showed the names of your scripts.
Re: Nice!
Posted:
Thu May 25, 2006 10:00 am
by John Sindelar
Nate wrote:Now, the only thing that would make this even sweeter is if you could have a Value List that showed the names of your scripts.
ScriptNames ( fileName ) should probably be unstored, but set that to a stored text field and you can use that field as your value list.
...
Posted:
Thu May 25, 2006 11:32 am
by Nate
My day just got even better...
So, what if I wanted to just show the scripts that start with "GoTo_"?
Did a little research on the Filter functions, but couldn't figure out how to make that work...
I sure hope someone else is learning from this too. There's a lot of potential with these few little tricks...
How does this calc work?
Posted:
Tue Mar 20, 2007 9:22 am
by tracydel
Does anyone know of a link of where I can see an example of how to use this?
Posted:
Tue Mar 20, 2007 9:38 am
by John Sindelar
I don't, unfortunately. The plugin example is designed to help folks write plugins, but the function most people are interested in is the one that runs a script by script name. The function is pretty straightforward:
XMpl_StartScript( filename; scriptname )