Get Files
From UBot Studio
(Difference between revisions)
(→Example) |
|||
Line 8: | Line 8: | ||
add list to list(%my list, $get files("C:\\Users\\UBook\\Desktop\\UBot Wiki\\Variable Functions", "Yes"), "Delete", "Global") | add list to list(%my list, $get files("C:\\Users\\UBook\\Desktop\\UBot Wiki\\Variable Functions", "Yes"), "Delete", "Global") | ||
</pre> | </pre> | ||
+ | |||
[[File:getfiles.png]] | [[File:getfiles.png]] | ||
+ | |||
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. | 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. | ||
+ | |||
<pre> | <pre> | ||
Line 17: | Line 20: | ||
add list to list(%my list, $get files("C:\\Users\\UBook\\Desktop\\UBot Wiki\\Variable Functions", "No"), "Delete", "Global") | add list to list(%my list, $get files("C:\\Users\\UBook\\Desktop\\UBot Wiki\\Variable Functions", "No"), "Delete", "Global") | ||
</pre> | </pre> | ||
+ | |||
[[File:getfiles1.png]] | [[File:getfiles1.png]] |
Revision as of 16:52, 15 April 2013
$Get Files is a File Function. The function returns the 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.
Example
add list to list(%my list, $get files("C:\\Users\\UBook\\Desktop\\UBot Wiki\\Variable Functions", "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 list, $get files("C:\\Users\\UBook\\Desktop\\UBot Wiki\\Variable Functions", "No"), "Delete", "Global")
Setting Include File Path to No returns the contents of the folder along with the file path for each file.