【发布时间】:2013-02-22 19:38:43
【问题描述】:
我正在开发 AutoHotKey 中的一个程序,该程序可以自动将 .FTM (FamiTracker) 文件大量转换为 .WAV 的过程。问题是我希望它在每个循环中增加“send {down}”语句的值+1(以选择文件夹中的下一首歌曲)。
edit我已经更新了代码。增量语句有效,我只需要找到一种方法使整个程序循环根据需要多次转换文件夹中的所有文件(添加 +1 以发送 {down} 每个循环)。 现在的问题是它没有循环整个程序。感谢任何帮助!
以下是启动 FamiTracker 音乐应用程序后程序外观的摘录:
Sleep, 800 ; I want the program to loop back to here when it reaches the last line
click 20,30 ; clicks "file"
Sleep, 500
Send {down 2} ; clicks "open"
send {enter}
Sleep, 1200
click 211,128 ; clicks first filename in folder
Sleep, 1200
send {enter}
Sleep, 1000
click 20,30 ; clicks "file"
send {down 6}
send {enter} ; clicks "create wav"
Sleep, 1000
click 157,57 ; increase playcount to 2
Sleep, 500
send {enter}
Sleep, 1000
send {enter}
Sleep, 2500
send {enter}
click 20,30 ; clicks "file"
Sleep, 500
Send {down 2} ; clicks "open"
send {enter}
Sleep, 1200
click 211,128 ; clicks first filename in folder
Sleep, 1000
Jmp:=1
Loop
{
Send, {Down %Jmp%}
Jmp+=1
return
}
sleep, 100
send {enter}
Sleep, 1000
click 20,30 ; clicks "file"
send {down 6}
send {enter} ; clicks "create wav"
Sleep, 1000
click 157,57 ; increase playcount to 2
Sleep, 500
send {enter}
Sleep, 1000
send {enter}
Sleep, 2500
send {enter}
Sleep, 1000 ; final line of code, want it to loop back to line 1 to repeat process till all files in folder are converted
我被困了很长时间,有什么想法吗?我本质上希望光标在程序的每个循环之后移动到下一首歌曲。程序第一次运行时,它会加载歌曲 1,一旦歌曲 1 完成,它会重复该过程,但继续单击歌曲 2,以此类推。
非常感谢
【问题讨论】:
-
我没有将其写在答案中,而是更新了您的代码。循环花括号需要在代码之外,您可能需要检查是否已到达文件列表的末尾。
-
刚刚看到我的更新没有被接受......
标签: loops converter autohotkey