March 16, 20205 yr 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?
March 16, 20205 yr 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?
March 16, 20205 yr Author I want to run a script in the other file, depending on the value of a parameter.
March 16, 20205 yr 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?
March 16, 20205 yr Author Te attached file shows the scripts I am using.Parent and child file scripts.docx
March 17, 20205 yr You don't need the IF in the parent script, just keep line 4 and replace lines 6 through 14 with Other than that, what did you want to change?
March 17, 20205 yr Author 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.
March 17, 20205 yr In your child file you need to capture the script parameter. Are you doing that? Set Variable [$sp = Get(ScriptParameter)]
March 17, 20205 yr Author 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
Create an account or sign in to comment