Skip to main content

Call a script within a script

Hi all,
I have created several scripts, one for each test. Now I want to run all of these scripts (or only some of them). My idea is to create a new script (maybe with option fields) from where I could start the other scripts. Is that possible?
Thank you,
Ole

JHDCC Thu, 12/13/2018 - 09:14

Hi brian, is there a simple way to run macros/scripts with a master script, without all the buttons etc?
ie within the Macros.ILB folder, i have macro1.iss, macro2.iss ... up to say, macro20.iss
My aim is to run mastermacro.iss, which just calls macros 1-20 and runs them consecutively. I don't need any user involvement as the process is fixed and any changes would require a rewrite of the sub-macros.
Thanks for all your help. Great resource, but some of the scripts are a big jump from tweaking/altering a recorded macro, to the above. Any suggested reading/resources as a beginners guide to scripting/visualbasic?

Brian Element Sat, 12/15/2018 - 13:28

Hi JHDCC, here are two examples for you.  The first doesn't send any parameters while the second sends parameters to the scripts.  You can mix the two so you can have the first with no parameters and the second with paramers and so on.


'example of running a script with no parameters

Sub Main
	'Run 4 scripts after each other.
	Client.RunIDEAScript "Script1.ISS"
	Client.RunIDEAScript "Script2.ISS"
	Client.RunIDEAScript "Script3.ISS"
	Client.RunIDEAScript "Script4.ISS"
End Sub

'example of running a script with up to four parameters
Sub Main
	'Run 4 scripts after each other.  Parameters would be of a string format.
	Client.RunIDEAScriptEx  "Script1.ISS", "arg1", "arg2", "arg3", "arg4" 'example of sending 4 parameters to the script being called
	Client.RunIDEAScriptEx  "Script2.ISS", "arg1", "arg2", "arg3", "" 'example of sending 3 parameters to the scirpt being called
	Client.RunIDEAScriptEx  "Script3.ISS", "arg1", "arg2", "", "" 'example of sending 2 parameters to the scirpt being called
	Client.RunIDEAScriptEx  "Script4.ISS", "arg1", "", "", "" 'example of sending 1 parameter to the scirpt being called
End Sub

idemnos Thu, 03/07/2019 - 10:28

Hi, there. I'm trying to execute the example you post, Brian. I pasted all files in Macros.ILB folder, when I run the Main and click button 1 and 2, the message: "invalid macro file name" shows. I reviewed the Idea language reference and syntaxis is correct (compared to the examples it has). Please help.

Edyn Fri, 12/17/2021 - 12:23

Si desean ejecutar otro Scrip llamandolo desde otro se debe colocar el Scrip que se desea llamar en la carpeta del proyecto y este codigo de llamado ***Client.RunIDEAScript  "AutoNumber.iss"**al final del scrip que se esta ejecutando primero
 
 

The website encountered an unexpected error. Try again later.