Call a script within a script

17 posts / 0 new
Last post
JHDCC
Offline
Joined: 02/15/2017 - 11:28

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's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

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
JHDCC
Offline
Joined: 02/15/2017 - 11:28

That's great Brian. Thanks for all your help.

idemnos's picture
idemnos
Offline
Joined: 06/17/2016 - 13:25

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.

JHDCC
Offline
Joined: 02/15/2017 - 11:28

Hi,
I had this error too, but found the solution in the link below. The macros need to be in the project folder, not the macros folder.
http://ideascripting.com/comment/966#comment-966

Edyn
Offline
Joined: 02/04/2021 - 13:44

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
 
 

Pages