Jump to content

pass script parameter to a script in another file


Recommended Posts

How can I pass a script parameter to a scrip in another file. I want to be able to run a script in asecond file based on the script parameter used in a first file. Or, is there a better way to do this instead of using script parameters?

Link to post
Share on other sites

There is no functional difference between calling scripts (and passing parameters to it) that belong to the same file or that live in different files...

Do you want to conditionally run this script or another script depending on the value of a parameter?

Link to post
Share on other sites

That would make it an IF statement that branches based on the parameter and just calls the script in the other file.  You'll need a file reference to the other file and once you've added the file reference you'll have access to all the scripts in the other file.  Obviously the user's privilege set in the other file will dictate whether the scripted actions are allowed.

If you don't want to add a file reference to the other file then that's another ball of wax; is that what you're after?

 

Link to post
Share on other sites

You don't need the IF in the parent script, just keep line 4 and replace lines 6 through 14 with

 

image.thumb.png.cf828ef5d7c16488ee05b3a48fedb3ae.png

 

Other than that, what did you want to change?

 

Link to post
Share on other sites

It still doesn't work. Script debugger and DataViewer show that $sp is set correctly in the parent script, however it is blank in the child script so the correct step does not execute. In other words the parameter is not passed to the the other file.

Link to post
Share on other sites

In your child file you need to capture the script parameter. Are you doing that?

Set Variable [$sp = Get(ScriptParameter)]

Link to post
Share on other sites

Nope, I forgot it. It now works like a charm. Thanks for all your help. You're working pretty early in the morning aren't you?

John

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Who Viewed the Topic

    1 member has viewed this topic:
    littlered136 

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.