WinExist
このスクリプトで開いている「名前を付けて保存」ボックスがあるかどうかを調べようとしています
if WinExist,Save As,Save As
MsgBox, is there
else
MsgBox, is not there
WinExist
このスクリプトで開いている「名前を付けて保存」ボックスがあるかどうかを調べようとしています
if WinExist,Save As,Save As
MsgBox, is there
else
MsgBox, is not there
元のコードはほぼ正しいです:
if
との間のスペースをWinExist
削除する必要があります。ifWinExist
ですWinTitle
。[名前を付けて保存] ダイアログに「名前を付けて保存」というテキストが含まれていない場合は、その 2 番目のパラメーターを削除する必要があります。これは、英語 (オーストラリア) の地域設定を使用した Windows 7 システムの場合です。作業例:
; ifWinExist command
ifWinExist, Save As
MsgBox, is there
else
MsgBox, is not there
; if(expression) and WinExist() function
if WinExist("Save As")
MsgBox, is there
else
MsgBox, is not there
条件を組み合わせることもできます:
ifWinExist, Save As ahk_class #32770
それがOSのウィンドウであると仮定すると、私は次のようにします、
^F1:: ;press Control + F1 to serch the window.
if FindWindow()
msgbox Found
else
msgbox Not Found
Return
FindWindow(strPartOfTitle="Save", strClass="#32770") {
if (hWnd := WinExist("ahk_class " . strClass))
{
WinGetTitle, strWinTitle, ahk_id %hWnd%
if InStr(strWinTitle, strPartOfTitle)
return true
else
return false
}
}