Jump to content

pass script parameter to a script in another file


This topic is 1782 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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?

Posted

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?

Posted

I want to run a script in the other file, depending on the value of a parameter.

Posted

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?

 

Posted

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?

 

Posted

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.

Posted

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

Set Variable [$sp = Get(ScriptParameter)]

Posted

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

This topic is 1782 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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