2014-09-02 157 views
2

我正在嘗試爲一個班次的開始創建一個消息框,並根據選擇的是/否選項執行操作。AHK if語句忽略條件

問題是,無論if語句都將是我的條件是否選擇是或否

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 
} 

編輯:當試圖使用IfMsgBox,收到以下錯誤:

enter image description here

回答

3

改爲使用IfMsgBox

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

嘗試上面的代碼時,出現「參數#1無效」錯誤 – 2014-09-02 21:12:45

+0

我添加了錯誤的屏幕截圖。 – 2014-09-02 21:23:46

+1

@DavidMetcalfe檢查我的編輯:語法錯誤可能是由於塊語法無效。我已經證實上述現在在我的環境中按照預期工作。 – admdrew 2014-09-02 21:31:47