Loop (normal) | Perform a series of commands repeatedly: either the specified number of times or until break is encountered. |
Loop (files & folders) | Retrieves the specified files or folders, one at a time. |
Loop (parse a string) | Retrieves substrings (fields) from a string, one at a time. |
Loop (read file contents) | Retrieves the lines in a text file, one at a time (performs better than FileReadLine). |
Loop (registry) | Retrieves the contents of the specified registry subkey, one item at a time. |
Loop, 3 { MsgBox, Iteration number is %A_Index%. ; A_Index will be 1, 2, then 3 Sleep, 100 } Loop { if a_index > 25 break ; Terminate the loop if a_index < 20 continue ; Skip the below and start a new iteration MsgBox, a_index = %a_index% ; This will display only the numbers 20 through 25 }
;파일폴더 루프
;Loop, FilePattern [, IncludeFolders?, Recurse?]
;폴더나 파일갯수 만큼 루프
Parameters
FilePattern | The name of a single file or folder, or a wildcard pattern such as C:\Temp\*.tmp. FilePattern is assumed to be in %A_WorkingDir%if an absolute path isn't specified. Both asterisks and question marks are supported as wildcards. A match occurs when the pattern appears in either the file's long/normal name or its 8.3 short name. If this parameter is a single file or folder (i.e. no wildcards) and Recurse is set to 1, more than one match will be found if the specified file name appears in more than one of the folders being searched. |
IncludeFolders? | One of the following digits, or blank to use the default: 다음 숫자 중 하나, 또는 기본 사용하기 빈 : |
Recurse? | One of the following digits, or blank to use the default: 0 (default) Subfolders are not recursed into. 하위폴더 비포함 1 Subfolders are recursed into so that files and folders contained therein are retrieved if they match FilePattern. All subfolders will be recursed into, not just those whose names match FilePattern. 하위 폴더 포함 |
Special Variables Available Inside a File-Loop
The following variables exist within any file-loop. If an inner file-loop is enclosed by an outer file-loop, the innermost loop's file will take precedence:
A_LoopFileName | The name of the file or folder currently retrieved (without the path). 경로 없이 파일이나 폴더 이름 |
A_LoopFileExt | The file's extension (e.g. TXT, DOC, or EXE). The period (.) is not included. 확장자 없이 |
A_LoopFileFullPath | The full path and name of the file/folder currently retrieved. However, if FilePattern contains a relative path rather than an absolute path, the path here will also be relative. In addition, any short (8.3) folder names in FilePattern will still be short (see next item to get the long version). 상대경로? |
A_LoopFileLongPath | This is different than A_LoopFileFullPath in the following ways: 1) It always contains the absolute/complete path of the file even if FilePattern contains a relative path; 2) Any short (8.3) folder names in FilePattern itself are converted to their long names; 3) Characters in FilePattern are converted to uppercase or lowercase to match the case stored in the file system. This is useful for converting file names -- such as those passed into a script as command line parameters -- to their exact path names as shown by Explorer. 전체경로? |
A_LoopFileShortPath | The 8.3 short path and name of the file/folder currently retrieved. For example: C:\MYDOCU~1\ADDRES~1.txt. However, ifFilePattern contains a relative path rather than an absolute path, the path here will also be relative. To retrieve the complete 8.3 path and name for a single file or folder, specify its name for FilePattern as in this example: Loop, C:\My Documents\Address List.txt ShortPathName = %A_LoopFileShortPath% NOTE: This variable will be blank if the file does not have a short name, which can happen on systems where NtfsDisable8dot3NameCreation has been set in the registry. It will also be blank if FilePattern contains a relative path and the body of the loop uses SetWorkingDir to switch away from the working directory in effect for the loop itself. |
A_LoopFileShortName | The 8.3 short name, or alternate name of the file. If the file doesn't have one (due to the long name being shorter than 8.3 or perhaps because short-name generation is disabled on an NTFS file system), A_LoopFileName will be retrieved instead. |
A_LoopFileDir | The full path of the directory in which A_LoopFileName resides. However, if FilePattern contains a relative path rather than an absolute path, the path here will also be relative. A root directory will not contain a trailing backslash. For example: C: |
A_LoopFileTimeModified | The time the file was last modified. Format YYYYMMDDHH24MISS. |
A_LoopFileTimeCreated | The time the file was created. Format YYYYMMDDHH24MISS. |
A_LoopFileTimeAccessed | The time the file was last accessed. Format YYYYMMDDHH24MISS. |
A_LoopFileAttrib | The attributes of the file currently retrieved. |
A_LoopFileSize | The size in bytes of the file currently retrieved. Files larger than 4 gigabytes are also supported. |
A_LoopFileSizeKB | The size in Kbytes of the file currently retrieved, rounded down to the nearest integer. |
A_LoopFileSizeMB | The size in Mbytes of the file currently retrieved, rounded down to the nearest integer. |
'만드는 이야기 > 기타' 카테고리의 다른 글
오토핫키) 메모장이 종료되면 다시실행시키고 숫자 입력 및 툴팁 표시 (0) | 2014.03.14 |
---|---|
오토핫키) 키보드 인식 또는 입력 (0) | 2014.03.13 |
오토핫키) 인풋 박스 (0) | 2014.03.13 |
오토핫키)메세지박스 띄우기 (0) | 2014.03.13 |
오토핫키)이미지랑 일치하는 위치 클릭하기 (0) | 2014.03.13 |