David Metcalfe
David Metcalfe

Reputation: 2412

AHK if statement ignoring conditions

I'm trying to create a message box for the start of a shift and perform actions based on the Yes/No options selected.

Problem is, the if statement fires the Yes condition regardless whether I select Yes or No.

MsgBox, 4, Shift start check, Are you just starting your shift? Clicking Yes will open applications/URLs for shift start.

if (MsgBox = Yes){
    Run http://wiki/ 
    Run Outlook
}
else {
    Run www.google.ca
}

Edit: When trying to use IfMsgBox, the following error is received:

enter image description here

Upvotes: 2

Views: 392

Answers (1)

admdrew
admdrew

Reputation: 3863

Use IfMsgBox instead:

IfMsgBox, Yes
{
    Run http://wiki/
    Run Outlook
}
else
{
    Run www.google.ca
}

Upvotes: 3

Related Questions