新しいプログラムを開始する前に、プログラムが完了するのを待つための方法を見つける必要があります。新しいプロセスを開始する前に前のプロセスが完了するのを待つ
基本的には、アプリケーションを開いていくつかのパラメータを入力するスクリプトがあります。アプリケーションは、入力データを処理するのに不明な時間を費やします。
残念ながら、現時点では、アプリケーションが処理を終了する前にahkスクリプトが終了し、その時点で同じahkスクリプトが再度実行され、前の処理を中断/中断します。
編集:(AHK .exeファイルをPythonでサブプロセスの呼び出しを使用して呼ばれている)
はこれで助ける方法またはいずれかの方法がありますか?参考のため
、スクリプト:
#NoEnv
CoordMode, Mouse, Window
SendInput Mode 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
{
Run, "C:\Program Files\Agisoft\PhotoScan Pro\photoscan.exe"
}
sleep, 200
WinActivate, ahk_exe photoscan.exe
sleep,5
WinMaximize, ahk_exe photoscan.exe
;Macro5:
Click, 476, 438, 0
SendInput {LControl Down}
SendInput {r}
Click, -56, 157, 0
WinActivate, Run Python Script ahk_class QWidget
sleep, 400
SendInput {LControl Up}
SendInput {LControl Down}
SendInput {a}
SendInput {LControl Up}
sleep, 400
SendInput {Backspace}
SendInput %1% ; 1st argument is the photoScan API scriptimages folder directory
SendInput {Tab}
SendInput {Tab}
sleep, 400
SendInput {LControl Down}
SendInput {a} ; 2nd argument is additional args (in our case, the projectName)
SendInput {LControl Up}
SendInput {Backspace}
SendInput %2% ; 2nd argument is the images folder directory & name of output log, model and texture
Sleep, 703
SendInput {Enter}
Click, 476, 438, 0
Return
これはどの言語ですか?確かにPythonではありません。 –
AutoHotKey(AHK)。しかし、それはPython内のサブプロセスモジュールによって呼び出されています。私はPythonにリンクしていました。なぜなら、PythonでAHK –