2014-09-30 3 views
2

Как продолжить работу с сценарием внутри окна сообщений, если нажать «Да»?AutoHotKey - MsgBox (Else/If)

;Print FIA Forside. 
MsgBox, 4, Print Forside?, Vil du printe en forside til denne sending? (press Yes or No 
IfMsgBox Yes 

;Find the shipment in EDI - Open the excel file and print it! 
    Click 2206,581 
    Click 1435,326 
    Send {Ctrl Down}c{Ctrl Up} 
    Click 1886,1044 


else 
    MsgBox You pressed No. 

Я получаю следующее сообщение об ошибке:

Error: ELSE with no matching IF 

ответ

4

Вы использовать фигурные скобки, чтобы обернуть ваш код. Пример:

;Print FIA Forside. 
MsgBox, 4, Print Forside?, Vil du printe en forside til denne sending? (press Yes or No) 
IfMsgBox Yes 
{ 
    msgBox, You pressed yes! 
    ; Put more code here 
} 
else 
{ 
    msgBox, You pressed no! 
} 
Смежные вопросы