Jakobi Posted December 29, 2006 Share Posted December 29, 2006 Hello, I am new to this and had a question. I have a msg box that is set to yes/no. How do I define upon selection the next action, if that makes sense. IE. If they press yes I need it to open a file, and if they press no it closes the script? Thanks for any direction. Also, is there a way to change the autoit icon so that the scripts can appear different to my users. Link to comment Share on other sites More sharing options...
Xenobiologist Posted December 29, 2006 Share Posted December 29, 2006 Hi, If MsgBox(4, "Example", "Press a button :-)") = 6 Then MsgBox(0, "OK", "You pressed Yes!", 3) Else MsgBox(0, "Cancel", "You pressed No!", 3) EndIf And compile with options offers the possibility to change the icon. So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
wkeeter Posted December 29, 2006 Share Posted December 29, 2006 (edited) Hello,I am new to this and had a question. I have a msg box that is set to yes/no. How do I define upon selection the next action, if that makes sense.IE.If they press yes I need it to open a file, and if they press no it closes the script?Thanks for any direction.Also, is there a way to change the autoit icon so that the scripts can appear different to my users.If you use SCITE as your editor it has awsome tools in it to help you code. The tool you want is called CodeWizard and will make any kind of message box you want + a whole lot more.SCITE FILES: http://www.autoitscript.com/autoit3/scite/downloads.php Edited December 29, 2006 by wkeeter Link to comment Share on other sites More sharing options...
Jakobi Posted December 29, 2006 Author Share Posted December 29, 2006 If you use SCITE as your editor it has awsome tools in it to help you code. The tool you want is called CodeWizard and will make any kind of message box you want + a whole lot more.SCITE FILES: http://www.autoitscript.com/autoit3/scite/downloads.phpThank you. I am unable to find "Codewizard" in the downloads, am I over seeing something?Cheers Link to comment Share on other sites More sharing options...
Valuater Posted December 29, 2006 Share Posted December 29, 2006 Thank you. I am unable to find "Codewizard" in the downloads, am I over seeing something?CheersIn SciTE... pressTools > CodeWizardand it is a great tool8) Link to comment Share on other sites More sharing options...
Jakobi Posted December 29, 2006 Author Share Posted December 29, 2006 I guess I only had AutoIt installed before...so now I have it. Thanks. Also figured out how to change the icon. Thanks again. Is this close: If MsgBox(4100, "Pipeline Reports", "Would you like to try to logon now?", 60) = 6 Then FileGetShortcut("shortcut.lnk") Else MsgBox(0, "Cancel", "Any questions then contact me.", 3) EndIf Is this close...trying to get it so when yes is clicked it opens my shortcut Link to comment Share on other sites More sharing options...
BigDod Posted December 29, 2006 Share Posted December 29, 2006 I guess I only had AutoIt installed before...so now I have it. Thanks. Also figured out how to change the icon. Thanks again. Is this close: If MsgBox(4100, "Pipeline Reports", "Would you like to try to logon now?", 60) = 6 Then FileGetShortcut("shortcut.lnk") Else MsgBox(0, "Cancel", "Any questions then contact me.", 3) EndIf Is this close...trying to get it so when yes is clicked it opens my shortcutThat will not open your shortcut but will give you info about the shortcut. Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted December 29, 2006 Moderators Share Posted December 29, 2006 (edited) Untested, but I imagine ShellExecute will work:If MsgBox(4100, "Pipeline Reports", "Would you like to try to logon now?", 60) = 6 Then $aSCut = FileGetShortcut("shortcut.lnk") If IsArray($aSCut) Then ShellExecute($aSCut[0]) Else MsgBox(16, 'Error', 'There was an error getting the Path') EndIf Else MsgBox(0, "Cancel", "Any questions then contact me.", 3) EndIf Edit: Guess it would help if I knew that FileGetShortCut() returned an array Edited December 29, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. 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