AutoScriptWriter を使用してすべてマウス クリックで作成した小さなマクロを作成しましたが、作成直後はうまく機能しましたが、後でそのマクロが動作しているプログラムを開いてマクロを開始すると、システム トレイに表示されましたが、何も起こりませんでした。私はまだホットキーを割り当てておらず、マクロをクリックして実行していました。私は何を間違っていますか?
ありがとう、エレン
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
run C:\Program Files\VinylStudio\VinylStudio.exe, , max
#SingleInstance Force
#installKeybdHook
#Persistent
SetTitleMatchMode, 2 ; Allow more flexibility in matching the windows title.
SetTimer, CloseScript, 1000
Return ; stop the script here on startup
CloseScript:
IfWinExist ahk_class VinylStudio_main
Return
ExitApp
#ifWinActive ahk_class VinylStudio_main
^h:: ; Here I assigned the hotkey [Ctrl]+h
WinActivate, VinylStudio
WinWait, VinylStudio, , 3 ; Wait for 3 seconds and then alert user
if ErrorLevel
{
MsgBox, VinylStudio timed out.
return
}
MouseClick, left, 479, 79 ; MouseClicks are less reliable than keyboard shortcuts or ControlSend/ControlClick.
Sleep, 100
MouseClick, left, 421, 40
Sleep, 100
MouseClick, left, 425, 443
Sleep, 100
WinWait, Filter Settings, , 3 ; Wait 3 seconds for pop-up else alert user
if ErrorLevel
{
MsgBox, Filter Settings timed out.
return
}
MouseClick, left, 29, 109
Sleep, 100
WinWait, Define Noise Sample, , 3 ; Wait 3 seconds for pop-up else alert user
if ErrorLevel
{
MsgBox, Define Noise Sample timed out.
return
}
MouseClick, left, 388, 168
Sleep, 100
MouseClick, left, -86, 660, 2
;MouseClick, left, -86, 660
Sleep, 100
WinWait, VinylStudio, , 3 ; Wait 3 seconds for pop-up else alert user
if ErrorLevel
{
MsgBox, VinylStudio timed out.
return
}
MouseClick, left, 200, 675, 2
;MouseClick, left, 200, 675
Sleep, 100
MouseClick, left, 200, 675, 2
;MouseClick, left, 200, 675
Sleep, 100
MouseClick, left, 201, 673
Sleep, 100
MouseClick, left, 203, 673, 2
;MouseClick, left, 203, 673
Sleep, 100
MouseClick, left, 203, 673
Sleep, 100
MouseClick, left, 787, 645
Sleep, 100
Return
#ifwinactive