Hi All,
Could anyone suggest how I can launch script B from script A and use any values generated in script B in script A?
So Script A is like
"... Do some stuff..."
Macro>C:\ScriptB
"... Do some stuff involving ProductName..."
ScriptB is like
VBSTART
"...open a file and retrieve a value calling it ProductName..."
VBEND
Any ideas?
Pass variables between scripts
Moderators: JRL, Dorian (MJT support)
-
- Newbie
- Posts: 15
- Joined: Wed Feb 15, 2006 2:25 pm
- Location: London
Several methods could be used. You could write the info to memory using PutClipBoard> and read it back using GetClipBoard> or you could write the informatin to a file using WriteLn> then read it back using ReadLn>. But the cleanest method would be to use the variable designed for this situation. The "MACRO_RESULT" variable is described in the help section under the Macro> command. A sample script follows:
Let>file1=C:\~~macroresulttest~~.scp
IfFileExists>%file1%
DeleteFile>%file1%
EndIf
WriteLn>%file1%,wresult,Let>test1=The first value
WriteLn>%file1%,wresult,Let>test2=The second value
WriteLn>%file1%,wresult,Let>test3=The third value
WriteLn>%file1%,wresult,Let>MACRO_RESULT=%test1%;%test2%;%test3%
Macro>%file1%
DeleteFile>%file1%
Separate>MACRO_RESULT,;,var
MDL>var_1 = %var_1%%CRLF%var_2 = %var_2%%CRLF%var_3 = %var_3%Let>file1=C:\~~macroresulttest~~.scp
IfFileExists>%file1%
DeleteFile>%file1%
EndIf
WriteLn>%file1%,wresult,Let>test1=The first value
WriteLn>%file1%,wresult,Let>test2=The second value
WriteLn>%file1%,wresult,Let>test3=The third value
WriteLn>%file1%,wresult,Let>MACRO_RESULT=%test1%;%test2%;%test3%
Macro>%file1%
DeleteFile>%file1%
Separate>MACRO_RESULT,;,var
MDL>var_1 = %var_1%%CRLF%var_2 = %var_2%%CRLF%var_3 = %var_3%
Hope this is helpful,
Dick
Let>file1=C:\~~macroresulttest~~.scp
IfFileExists>%file1%
DeleteFile>%file1%
EndIf
WriteLn>%file1%,wresult,Let>test1=The first value
WriteLn>%file1%,wresult,Let>test2=The second value
WriteLn>%file1%,wresult,Let>test3=The third value
WriteLn>%file1%,wresult,Let>MACRO_RESULT=%test1%;%test2%;%test3%
Macro>%file1%
DeleteFile>%file1%
Separate>MACRO_RESULT,;,var
MDL>var_1 = %var_1%%CRLF%var_2 = %var_2%%CRLF%var_3 = %var_3%Let>file1=C:\~~macroresulttest~~.scp
IfFileExists>%file1%
DeleteFile>%file1%
EndIf
WriteLn>%file1%,wresult,Let>test1=The first value
WriteLn>%file1%,wresult,Let>test2=The second value
WriteLn>%file1%,wresult,Let>test3=The third value
WriteLn>%file1%,wresult,Let>MACRO_RESULT=%test1%;%test2%;%test3%
Macro>%file1%
DeleteFile>%file1%
Separate>MACRO_RESULT,;,var
MDL>var_1 = %var_1%%CRLF%var_2 = %var_2%%CRLF%var_3 = %var_3%
Hope this is helpful,
Dick
-
- Newbie
- Posts: 15
- Joined: Wed Feb 15, 2006 2:25 pm
- Location: London