View Issue Details

IDProjectCategoryView StatusLast Update
0019093MMW 5Extensions frameworkpublic2022-08-31 00:03
Reporterzvezdan Assigned To 
PriorityhighSeverityminorReproducibilityN/A
Status closedResolutionfixed 
Product Version5.0 
Target Version5.0.4Fixed in Version5.0.4 
Summary0019093: Method to get the list of files in a folder needed
DescriptionI looked everywhere in your scripts and cannot find it. You know, something like:
Set oFileObj = CreateObject("Scripting.FileSystemObject")
oFileObj.GetFolder("c:\Temp\").Files
TagsNo tags attached.
Fixed in build2650

Activities

Ludek

2022-05-25 18:16

developer   ~0068252

Last edited: 2022-05-25 19:58

There is https://www.mediamonkey.com/docs/api/classes/SharedFolder.html#method_getTracklist
i.e.
var folder = app.filesystem.getFolderFromString('C:\\Temp');
var tracklist = folder.getTracklist();
await tracklist.whenLoaded();

but you probably mean list of all files (not only media files) in a string list, right?

OK, then introducing folder.getFileList would be valuable addition here.

zvezdan

2022-05-25 18:22

updater   ~0068253

Yes, I want a list of any files, not only media files.

A string list will be fine, but I would prefer if you implement the File object as it exists in the MS' FileSystemObject. Then we could use it to get the file properties directly without using getFileInfoAsync and similar.

zvezdan

2022-05-25 18:24

updater   ~0068254

Here is link:
https://docs.microsoft.com/en-us/office/vba/language/reference/user-interface-help/file-object

Ludek

2022-05-25 20:39

developer   ~0068262

Last edited: 2022-05-25 20:41

Added in 5.0.4.2650

Can be used like this:
var list = folder.getFileList( true {recursive});
await list.whenLoaded();

With the recursive param set to true it lists files contained within subfolders too.
It returns string list (full paths), getFileInfoAsync can be used then on individual items.

peke

2022-08-31 00:03

developer   ~0069106

Verified 2661

Tested using 0019093:0068262 sample code