Call script by name determined by calc

General support questions.
PostPosted: Wed May 24, 2006 4:16 pm
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.

?
SeedCode Staff
SeedCode Staff
Posts: 2764
Joined: Thu Nov 20, 2003 11:01 am
PostPosted: Wed May 24, 2006 4:34 pm
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.
John Sindelar
SeedCode
PostPosted: Wed May 24, 2006 6:23 pm
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
SeedCode Staff
SeedCode Staff
Posts: 2764
Joined: Thu Nov 20, 2003 11:01 am
PostPosted: Wed May 24, 2006 7:29 pm
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 )
Last edited by John Sindelar on Tue Mar 20, 2007 9:26 am, edited 1 time in total.
John Sindelar
SeedCode
PostPosted: Thu May 25, 2006 9:18 am
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.

;-)
SeedCode Staff
SeedCode Staff
Posts: 2764
Joined: Thu Nov 20, 2003 11:01 am
PostPosted: Thu May 25, 2006 10:00 am
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.
John Sindelar
SeedCode
PostPosted: Thu May 25, 2006 11:32 am
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...
Posts: 1
Joined: Tue Mar 20, 2007 9:14 am
PostPosted: Tue Mar 20, 2007 9:22 am
Does anyone know of a link of where I can see an example of how to use this?
SeedCode Staff
SeedCode Staff
Posts: 2764
Joined: Thu Nov 20, 2003 11:01 am
PostPosted: Tue Mar 20, 2007 9:38 am
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 )
John Sindelar
SeedCode

Return to General Support

Who is online

Users browsing this forum: No registered users and 3 guests

(855) SEEDCODE
[email protected]
Follow us: