특정 위치를 "클릭"하려면 메뉴를 열려면 먼저 AutoHotKey 아이콘을 마우스 오른쪽 버튼으로 클릭하고 "창 스파이"를 열 수 있습니다. 이 창 스파이가 마우스 위치를 보여줍니다. Yo는 마우스 위치를 사용하여 활성 응용 프로그램에서 작업을 수행 할 수 있습니다.
예 :이 경우
SoundBeep 1000, 300 ; Wake up user
SplashTextOn, 200, 100, Script Preparations, Please Click on the person icon link. ; Show new Instructions text
WinMove, Script Preparations,, (A_ScreenWidth/2)+150, (A_ScreenHeight/2)+200 ; Move the window with the name "Script Preparations" Down and Right on the main screen
KeyWait, LButton, D ; Wait for LeftMouseButton click Down
MouseGetPos, xposE ,yposE ; Store the position where the mouse was clicked (Employee)
MouseClick, left, %xposE% ,%yposE%, 2 ; Perform a double mouse click on the captured mouse location
SplashTextOff ; Remove Text box
, 내가 먼저 수동으로 올바른 위치에 클릭하도록 요청합니다. 이것은 클릭 할 위치가 활성 창 (활성 창 내의 변수 타일) 내에서 변경 될 때만 필요합니다. 일단 그 위치가 저장되면 스크립트 전체에서 다시 사용할 수 있습니다.
b.tw 대신 Alt 키 + 탭를 사용하여, 나는이를 사용하는 것이 좋습니다 :
settitlematchmode, 1 ; Set search in title to start with....
settitlematchmode, Fast ; Slow is not required here. Slow is only required when hidden text needs to be found.
SwitchWindow("Microsoft Excel - 1 QRM Upload and Change Template") ; Activate the
window with the title: Microsoft Excel - 1 QRM Upload and Change Template
You could even use someting like this:
SetTitleMatchMode, 2 ; Ensure that the Title Match mode is set to 2: Find anywhere in the title
SetTitleMatchMode, Fast ; Ensure that the Title Match mode is set to FAST
winactivate, %WindowName% ; Activate the window with the title stored in the variable WindowName
WinWaitActive, %WindowName%, , 5 ; Wait up to five seconds for the screen
if ErrorLevel ; Execute this when the window is not activated within 5 seconds
{ ; Start-If Wait failed
SoundBeep 1000 , 1000 ; Warn the user
MsgBox,4097,Time Out, Script timed out while waiting for %WindowName%.`n`rYou Must manually activate %WindowName% and then continue the script by pressing OK. ; Message to user
IfMsgBox, Cancel ; Do when the user clicked on Cancel
{ ; Start-If User clicked Cancel
ExitApp ; Exit this program when the user clicked on Cancel
} ; End-If User clicked Cancel
WinWaitActive, %WindowName%, , 5 ; Try to activate the window AGAIN
if ErrorLevel ; If window can't be found
{ ; Start-If window can't be found
MsgBox,4096,Exit, %WindowName% still NOT Active. ; Warn user
ExitApp ; Exit this program when the expected window is still not found
} ; End-If window can't be found
} ; End-If Wait failed
감사합니다,
로버트 Ilbrink
감사합니다. WinActivate가 편리 해졌고, 많은 'Send'가 사용 종료 된 후 잠을 잘 수있었습니다. 클립 보드의 내용이 '보내기, % 클립 보드 %'로 '가상 붙여 넣기'될 수 있으므로 마우스 클릭을 사용하여 붙여 넣기 모드를 변경하지 않았습니다. – abcde123483