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
Ole
Offline
Last seen: 8 years 6 months ago
Joined: 01/28/2014 - 07:49
Hi Ole and welcome to the site. Yes it is, you can have up to 4 parameters that you can pass between scripts. I will try and put together an example for you to look at. It has been awhile since I have done this so give me a few days to refresh my memory and do an example for you.
Hi Brian,
thanks for the quick answer. I will wait.
Hello Ole,
Here is an example for you. The first script has a menu with 3 buttons, the first button sends 4 character variables to a second script which displays the characters, the second button does the same but with integers and the third button asks for your name and then the second script will display your name. You will notice that in the third example even though we are only sending one variable we have to use "" for the other three variables.
The receiving scripts obtain these variables through the arg1, arg2, arg3 and arg4 variables. In this example I am just displaying them but in a more complex script you can take these variables and then work with them. Unfortunately there is only 4 variables that you can send at a time. If you need more you probably need to write the variables to a text file from the first script and then open the text file in the second script to obtain the variables.
The example scripts, once complete, will open the menu script again. You will notice that the function is different. The function used in the example scripts to return to the main script cannot send variables, it simply open the script.
Let me know if this answers your question or if you need more info on this.
I have attached the script that I used so you can play with them.
Good luck.
Brian
Hi Brian,
Thank you so much for putting up this example. It is exactly what I am looking for. I have dowloaded your sample script and tried to run it however it said "Invalid macro filename". I am not sure if I have to copy the submacro to a specific folder in IDEA?
Many thanks,
Hi and welcome to the site.
Yes, the scripts have to be in the project folder, if you put them in the macros.ilb folder you will get this error. To use them in the macros folder you will have to add the location of the script.
Brian
Yes, that's what I wanted to know. Thank you very much. Yesterday I watched your tutorial and it was great. I thought IDEAscript is just a small uncomfortably "language" but your tutorial showed me that I was wrong. Well done!
Ole
Hi Ole,
Glad I could help and glad you enjoyed the videos. IDEAScript is actually a very powerful language once you learn it but like anything else it takes time to learn how to use it. Let me know if you have any subjects you want me to explain or cover in the future. I am always looking for topics that could help users out.
Brian
Hello Brian,
A s a follow up to this thread, is it possible to pass an array as one of the four variables? I am trying it and currently facing issues.
Thanks.
Hi Oseroke,
Sorry you can't pass an array. If you have more than four variables to pass you probably need to create a text file, save the information in the text file and then read it from the other script.
Brian
Okay thanks.
Pages