potitpanda Posted April 10, 2008 Share Posted April 10, 2008 Hi I have made a script with AutoIT and I want to launch Myscript /help on command Line, and as a result I Want to show a quick help of my script. How to do this ? Link to comment Share on other sites More sharing options...
DarkMatter Posted April 10, 2008 Share Posted April 10, 2008 Look for "Command Line Parameters" in the help file. That should point you in the right direction. [sub]Quantum mechanics: The dreams stuff is made of[/sub] Link to comment Share on other sites More sharing options...
Mojo Posted April 10, 2008 Share Posted April 10, 2008 Hi I have made a script with AutoIT and I want to launch Myscript /help on command Line, and as a result I Want to show a quick help of my script. How to do this ? Easiest way if you only want one command line switch: If $CmdLine[1] == "/help" Then Msgbox(0,"","some info") Exit EndIf The above example does only work if you pass the help parameter as the first parameter. Take a look at the documentation for command line switches. Everything is perfectly explained there. You can fool some of the people all of the time, and all of the people some of the time, but you can not fool all of the people all of the time. Abraham Lincoln - http://www.ae911truth.org/ - http://www.freedocumentaries.org/ Link to comment Share on other sites More sharing options...
potitpanda Posted April 10, 2008 Author Share Posted April 10, 2008 Look for "Command Line Parameters" in the help file. That should point you in the right direction.Hummm... ??? I Don't understand, in "Command Line parameters" that explain how to compile my script in command line ! That's not I Want to do !When I type Myscript /help on command line, that shows a litte text to help users of my scriptYou understand ? Link to comment Share on other sites More sharing options...
DarkMatter Posted April 10, 2008 Share Posted April 10, 2008 (edited) Re-read that section: Command Line Parameters The special array $CmdLine is initialized with the command line parameters passed in to your AutoIt script. Note the scriptname is not classed as a parameter; get this information with @ScriptName instead. A parameter that contains spaces must be surrounded by "double quotes". Compiled scripts accept command line parameters in the same way. $CmdLine[0] is number of parameters $CmdLine[1] is param 1 (after the script name) $CmdLine[2] is param 2 etc ... $CmdLine[$CmdLine[0]] is one way to get the last parameter... So if your script is run like this: AutoIt3.exe myscript.au3 param1 "this is another param" $CmdLine[0] equals... 2 $CmdLine[1] equals... param1 $CmdLine[2] equals... this is another param @ScriptName equals... myscript.au3 In addition to $CmdLine there is a variable called $CmdLineRaw that contains the entire command line unsplit, so for the above example: $CmdLineRaw equals... myscript.au3 param1 "this is another param" If the script was compiled it would have been run like this: myscript.exe param1 "this is another param" $CmdLineRaw equals... param1 "this is another param" Note that $CmdLineRaw just return the parameters. Note : only 63 parameters can be return by $CmdLine[...], but $CmdLineRaw will always returns the entire command line. Edited April 10, 2008 by DarkMatter [sub]Quantum mechanics: The dreams stuff is made of[/sub] Link to comment Share on other sites More sharing options...
Mojo Posted April 10, 2008 Share Posted April 10, 2008 Hummm... ??? I Don't understand, in "Command Line parameters" that explain how to compile my script in command line ! That's not I Want to do !When I type Myscript /help on command line, that shows a litte text to help users of my scriptYou understand ?Have you even read my post? Isn't that exactly what you want?! You can just copy my code, change the "some info" text and be happy! You can fool some of the people all of the time, and all of the people some of the time, but you can not fool all of the people all of the time. Abraham Lincoln - http://www.ae911truth.org/ - http://www.freedocumentaries.org/ Link to comment Share on other sites More sharing options...
Richard Robertson Posted April 10, 2008 Share Posted April 10, 2008 No you idiots. The OP is wanting output to a console. AutoIt is, when compiled normally, a Windows application. It doesn't connect to the console window unless you do some weird fiddling by tracking down the spawning process and attaching to its console. Link to comment Share on other sites More sharing options...
Mojo Posted April 10, 2008 Share Posted April 10, 2008 No you idiots. The OP is wanting output to a console.AutoIt is, when compiled normally, a Windows application. It doesn't connect to the console window unless you do some weird fiddling by tracking down the spawning process and attaching to its console.wtf is wrong with you? You can fool some of the people all of the time, and all of the people some of the time, but you can not fool all of the people all of the time. Abraham Lincoln - http://www.ae911truth.org/ - http://www.freedocumentaries.org/ Link to comment Share on other sites More sharing options...
Mojo Posted April 10, 2008 Share Posted April 10, 2008 Hey potitpanda, I guess you quoted my post cause that was the answer to your question, right? Glad I could you @Richard Who's the idiot now? I wouldn't be so offensive, since we all are just trying to help each other!! Thank you! You can fool some of the people all of the time, and all of the people some of the time, but you can not fool all of the people all of the time. Abraham Lincoln - http://www.ae911truth.org/ - http://www.freedocumentaries.org/ Link to comment Share on other sites More sharing options...
Richard Robertson Posted April 10, 2008 Share Posted April 10, 2008 Then you all need to learn how to communicate your problems properly because that's what I got out of it. Link to comment Share on other sites More sharing options...
Zedna Posted April 10, 2008 Share Posted April 10, 2008 (edited) If you need it like console application then try this:#AutoIt3Wrapper_Change2CUI=y If $CmdLine[0] > 0 Then If $CmdLine[1] = "/help" Then ConsoleWrite("some info") Exit EndIf EndIfYou must use Scite4AutoIt3 Edited April 10, 2008 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Richard Robertson Posted April 10, 2008 Share Posted April 10, 2008 Oh, and I want to say sorry for calling anyone an idiot. It was probably my fault for misreading something. Link to comment Share on other sites More sharing options...
potitpanda Posted April 11, 2008 Author Share Posted April 11, 2008 If you need it like console application then try this: #AutoIt3Wrapper_Change2CUI=y If $CmdLine[0] > 0 Then If $CmdLine[1] = "/help" Then ConsoleWrite("some info") Exit EndIf EndIf Okay It Works but What is the function of : #AutoIt3Wrapper_Change2CUI=y thanks for the replies Link to comment Share on other sites More sharing options...
Squirrely1 Posted April 11, 2008 Share Posted April 11, 2008 (edited) This line affects the compiler, to make your app a Command Prompt Console app instead of a windowed app, I think:#AutoIt3Wrapper_Change2CUI=yYou should expect this to work only if SciTe4AutoIt3 is installed, and only then after compiling the script. You should also expect that your app then can't have a GUI to it - I think - and this is what young RichardRobertson the no-idiot-whatever was trying to describe, howeverso politely.And yes, we do need both mojo and dark matter - there has been some question about squirrels.Edit: Striken text as per RichardRobertson Edited April 11, 2008 by Squirrely1 Das Häschen benutzt Radar Link to comment Share on other sites More sharing options...
potitpanda Posted April 11, 2008 Author Share Posted April 11, 2008 Do not irritate The question is solved. Thank you to all the people who answered to this post. Link to comment Share on other sites More sharing options...
Zedna Posted April 11, 2008 Share Posted April 11, 2008 Okay It Works but What is the function of : #AutoIt3Wrapper_Change2CUI=ythanks for the repliesIn Scite editor press Ctrl+F1 and go to Extra utilities/AutoIt3Wrapper sectionThere is detailed description of all AutoIt3Wrapper's directives. Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Richard Robertson Posted April 11, 2008 Share Posted April 11, 2008 I corrected you somewhere else too Squirrely, and for the sake of this thread, yes, you can use standard GUIs in a console application. Link to comment Share on other sites More sharing options...
Squirrely1 Posted April 11, 2008 Share Posted April 11, 2008 RichardRobertson - Thanks for the correction - I was hoping someone would double-check this since I haven't played with it. Das Häschen benutzt Radar 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