一系列操作在一个脚本中连续进行

时间:2015-10-08 21:28:18

标签: autohotkey

AutoHotkey的。 如何使用字符串,文件,变量等来制作一系列操作。从1到101。一个文件夹中的文件或一个文件夹中的文件夹,高字符串,一个脚本中的变量。通过更简单和经典的方法。

1 个答案:

答案 0 :(得分:0)

如果你想做多个类似的动作,使用某种形式的循环几乎总是一个好主意 数组也可以提供很多帮助。

这是一个文件/文件夹循环:

matplotlib

这是一个正常的循环:

Loop Files, C:\*.exe, R  ; get all .exe files that are on C:\ and subfolders of it
{
    MsgBox, Full path of the current file: %A_LoopFileFullPath%
    If (A_LoopFileName = "virus.exe") {
        MsgBox, A file called virus.exe was found.
    }
}

...

Loop, 101 ;run the following code 101 times
{
    MsgBox, This is iteration number %A_Index%
    If (A_Index = 10)
        MsgBox, Nice! You made it through 10 iterations!
}
相关问题