1
我有這個小腳本應該打開一個應用程序並鍵入一些字母。但是,由於某些原因,腳本不會運行一段代碼。它起來winMaximize然後停下來。但如果應用程序已經打開,那麼該部分運行?不知道我是否做錯了什麼,想法?腳本將不會運行一段代碼
#NoEnv
CoordMode, Mouse, Window
SendMode Input
#SingleInstance Force
SetTitleMatchMode 2
#WinActivateForce
SetControlDelay 1
SetWinDelay 0
SetKeyDelay -1
SetMouseDelay -1
SetBatchLines -1
;if 0 < 2 ; The left side of a non-expression if-statement is always the name of a variable.
;{
; MsgBox, This script requires 2 incoming parameters but it only received %0%.
; ExitApp
;}
IfWinNotExist, ahk_exe photoscan.exe
{
RunWait, "C:\Program Files\Agisoft\PhotoScan Pro\photoscan.exe"
}
WinActivate ; Automatically uses the window found above.
sleep,5
WinMaximize
;Macro5:
Click, 499, 426, 0
Click, 497, 427, 0
Click, 496, 427, 0
Click, 493, 428, 0
Click, 492, 429, 0
Click, 487, 431, 0
Click, 485, 433, 0
Click, 482, 435, 0
Click, 481, 435, 0
Click, 480, 435, 0
Click, 479, 436, 0
Click, 478, 436, 0
Click, 477, 437, 0
Click, 477, 438, 0
Click, 476, 438, 0
Send, {LControl Down}
Send, {r}
Click, -56, 157, 0
WinActivate, Run Python Script ahk_class QWidget
Send, {LControl Up}
Send, {LControl Down}
Send, {LControl Up}
Send, {LControl Down}
Send, {a}
Send, {LControl Up}
Send, {Backspace}
Send, {%1%} ; 1st argument is the images folder directory
Send, {Tab}
Send, {Tab}
Send, {LControl Down}
Send, {%2%} ; 2nd argument is additional args (in our case, the projectName)
Send, {LControl Up}
Send, {Backspace}
Send, {b}
Sleep, 703
Send, {Enter}
Click, 476, 438, 0
Return