感謝を。私はあなたのコードを追加し、それは動作したくない、スクリプトがロードされていないようです(タスクバーのアイコンなし)。最終的なコードは次のようになります。
#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.
#Include %A_ScriptDir%\WatchFolder.ahk
WatchFolder("C:\Users\kris\Desktop\temp", "myFunc", , Watch := 1)
return
myFunc(path, changes) {
for k, change in changes
; 1 means new file was added
if (change.action = 1) {
gosub doStuff
return
}
}
doStuff:
Send {Esc}
Sleep, 500
Send {F5}
Sleep, 100
Send {Home}
Sleep, 100
Send s
Sleep, 100
Send {Enter}
return
スクリプトと同じフォルダにWatchFolder.ahkを挿入しました。
これは、ホットキーがなく、ただ終了するためです。最初に '#Persistent'を追加すれば、それは動いていきます。 – Oleg
Thx!魅力的な作品:) –