snoopy.pa30 Posted February 4, 2012 Share Posted February 4, 2012 Newbie here tyring to handle joining many different pieces of different scripts to form a new script. I would like to have a master script file that launches sub scripts that need to finish (with a time out failsafe) before processing continues, ideally passing back a return code to indicate what has transpired. Not sure what commands to use and how to structure. I have been trying to READ the Manual, but not sure what I need. I am looking at the following possibilities: Call, Run, RunAs, RunAsWait, RunWait, ShellExecute, and ShellExecuteWait as the launch methods. So, what are preferred methods and what problems should I be watching out for? Thanks. Snoopy Snoopy=====Still trying to shoot down that Red Baron :-)) Link to comment Share on other sites More sharing options...
Bert Posted February 4, 2012 Share Posted February 4, 2012 Seeing that you are new, I recommend you take the AutoIt 1 2 3 course located in the example script section of the forum. This will answer all of your basic questions as well as provide basic training on how to script stuff. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
snoopy.pa30 Posted February 4, 2012 Author Share Posted February 4, 2012 Thanks MPH. I am trying to go through it, but it does not render properly on my system (I don't know why), so I can't see full descriptions of Exam Questions, and the Break time example (Object) did not work either. Anyway, as I have managed to make several smaller individual scripts that I am now trying to piece together, just looking for a little guidance on best practices for joining scripts in a manner that can isolate functional processes to make it easier to handle adjustments and errors. Essentially, do I make I HUGE (ugly) script and just brute force my way through, or can I make a pretty Master/Slave type of script to call individual apps from their respective slave process? Thanks Snoopy=====Still trying to shoot down that Red Baron :-)) Link to comment Share on other sites More sharing options...
snoopy.pa30 Posted February 4, 2012 Author Share Posted February 4, 2012 Just found Valuater's AutoIT Wrappers from Launching .au3 script within a Script Looks like it might be what I can use. Now I can get some sleep and try it in the morning with a clear head. Snoopy=====Still trying to shoot down that Red Baron :-)) Link to comment Share on other sites More sharing options...
Mikeman27294 Posted February 4, 2012 Share Posted February 4, 2012 (edited) Well, as it happens, I did a similar script yesterday. Rather than running multiple scripts, you can run the same one multiple times, with parameters. I'll give you a script example. Global $Output, $ProcessID For $Repeat = 1 To $CmdLine[0];The $cmdline array is automatically set by autoit. It contains any parameters given to the program when it is run. ;Hold Shift and press F8 in scite to set parameters. Enter "a" into the first box, without quotes. MsgBox(0,"",$CmdLine[$Repeat]) ;For debug reasons - shows you what the current parameter is. If $CmdLine[$Repeat] = "Function1" Then _Function1() EndIf Next If @Compiled = 1 Then $ProcessID = Run(FileGetShortName(@ScriptFullPath) & " Function1", @SW_SHOW, 0x02);0x02 = $STDOUT_CHILD Else $ProcessID = Run(FileGetShortName(@AutoItExe) & " " & FileGetShortName(@ScriptFullPath)& " Function1", @SW_SHOW, 0x02);0x02 = $STDOUT_CHILD EndIf Func _Function1() ConsoleWrite("This data should be displayed in a message box") Exit EndFunc That currently works to run the function. Unfortunately, I have no experience reading the STDOUT and I don't know how to have a script write to the stream. I will work on it though, because that's valuable information to know. Anyway, that will get you running the function. It won't do communicatins but I don't have a clue how to do that. Edited February 4, 2012 by Mikeman27294 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now