Directory 在AHK打开文件夹中第一个文件的方法

Directory 在AHK打开文件夹中第一个文件的方法,directory,autohotkey,Directory,Autohotkey,如果我想打开所有.jpg文件夹的第一个pic字母顺序,它将不起作用 Run ...\*.jpg ; First of all make sure that such a file exists in the folder specified If FileExist("D:\MyFolder\*.jpg") { ; loop through those files Loop, Files, D:\MyFolder\*.jpg { If (A_Inde

如果我想打开所有.jpg文件夹的第一个pic字母顺序,它将不起作用

Run ...\*.jpg
; First of all make sure that such a file exists in the folder specified
If FileExist("D:\MyFolder\*.jpg")
{
    ; loop through those files  
    Loop, Files, D:\MyFolder\*.jpg
    {
        If (A_Index = 1) ; as soon as the first file (in alphanumeric order) is retrievend
            Run %A_LoopFileFullPath% ; run this file
                break ; and terminate the loop
    }
}
else
    MsgBox, "D:\MyFolder" doesn't contain any jpg-files