2011-11-08 3 views
0

을 자동화하고 직접 다소 AutoHotkey를 구문에 양도 할 것 같습니다 :AutoHotkey를 승리 XP 내가 AutoHotkey를 함께 자동화 싶습니다 내가 작은 작업을 작은 작업

이제
1. Ctrl+v 
2. Alt+tab 
3. Click certain link in a window (no combo-key for this but it's always in the same place) 
4. Enter (carriage return) 
5. Alt+s 
6. Ctrl+v 
7. Enter 

가 매핑 할 좋은 것 예 : 다른 사람이 콤보 Windows 키 + 스페이스. 내가 지금까지 가지고 무엇

은 다음과 같습니다

0. SetWinDelay 100 (using a connection to an remote computer) 
0. SetKeyDelay 0 
1. Send, ^c 
1. ClipWait, 0.1 
2. Send, {Alt down}{tab} 
2. Send, {Alt up} 
3. ????? 
4. Send, {enter} 
5. Send, !s 
6. Send, ^v 
7. Send, {enter} 

이 약 권리인가? 누구나 그것을 고치거나 구멍을 채우는 데 도움을 준 사람이면 누구나 할 수 있습니다. :)

3 단계, 4 단계 및 6 단계의 또 다른 대안은 단순히 클립 보드의 내용 (숫자 문자열)을 반복하여 각 키 스트로크의 편지? 아마도 더 쉬운 방법 일 것입니다

답변

1

특정 위치를 "클릭"하려면 메뉴를 열려면 먼저 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

+0

감사합니다. WinActivate가 편리 해졌고, 많은 'Send'가 사용 종료 된 후 잠을 잘 수있었습니다. 클립 보드의 내용이 '보내기, % 클립 보드 %'로 '가상 붙여 넣기'될 수 있으므로 마우스 클릭을 사용하여 붙여 넣기 모드를 변경하지 않았습니다. – abcde123483

관련 문제