Sign in to follow this  
Followers 0
Jakobi

Simple Msgbox Question

8 posts in this topic

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.

Share this post


Link to post
Share on other sites



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

Share this post


Link to post
Share on other sites

#3 ·  Posted (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 by wkeeter

Share this post


Link to post
Share on other sites

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

Thank you. I am unable to find "Codewizard" in the downloads, am I over seeing something?

Cheers

Share this post


Link to post
Share on other sites

Thank you. I am unable to find "Codewizard" in the downloads, am I over seeing something?

Cheers

In SciTE... press

Tools > CodeWizard

and it is a great tool

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

That will not open your shortcut but will give you info about the shortcut.


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

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

Share this post


Link to post
Share on other sites

#8 ·  Posted (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 by SmOke_N

[center]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.[/center]

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0