Get Files
(One intermediate revision by one user not shown) | |||
Line 1: | Line 1: | ||
− | $ | + | $get files is a [[File Functions|File Function]] that returns a list of all files within a given directory. |
You can set the function to return all files with file paths included or only the name of the files with their extensions. | You can set the function to return all files with file paths included or only the name of the files with their extensions. | ||
Line 10: | Line 10: | ||
<pre> | <pre> | ||
− | add list to list(%my list, $get files("C:\\Users | + | add list to list(%my list,$get files("C:\\Users\\Desktop\\UBot Media\\Documents","Yes"),"Delete","Global") |
</pre> | </pre> | ||
− | [[File: | + | [[File:conpath.jpg]] |
Line 22: | Line 22: | ||
<pre> | <pre> | ||
clear list(%my list) | clear list(%my list) | ||
− | add list to list(%my | + | add list to list(%my list0,$get files("C:\\Users\\Desktop\\UBot Media\\Documents","No"),"Delete","Global") |
</pre> | </pre> | ||
− | [[File: | + | [[File:sanspath.jpg]] |
Setting Include File Path to No returns the contents of the folder along with the file path for each file. | Setting Include File Path to No returns the contents of the folder along with the file path for each file. |
Latest revision as of 18:41, 29 June 2023
$get files is a File Function that returns a list of all files within a given directory.
You can set the function to return all files with file paths included or only the name of the files with their extensions.
Folder To Search: The folder path to the folder where the desired files are located.
Include Path: Determines whether the files returned will include a file path. Selecting "Yes" will return the files complete with file paths. Selecting "No" will return the files without the file paths.
[edit] Example
add list to list(%my list,$get files("C:\\Users\\Desktop\\UBot Media\\Documents","Yes"),"Delete","Global")
The script is using the get files function to return the contents of a folder to populate the list. Setting Include File Path to Yes returns the contents of the folder along with the file path for each file.
clear list(%my list) add list to list(%my list0,$get files("C:\\Users\\Desktop\\UBot Media\\Documents","No"),"Delete","Global")
Setting Include File Path to No returns the contents of the folder along with the file path for each file.