Thank you.
So you want it to return directly if it finds any files. Not sure you can do that efficient with script yet.
I have not yet looked at the scripting limitations. Are you saying that the script does not have a return command that you could call if it encounters a file? Seriously? Well, as I just said, I will yet have to look at the scripting. Maybe it works differently than I would expect?
Yes you can return from script when you want.. That is not the problem.
The script commands are simpler then normal API. You can do FindFirstFile() that return first match or get all items from a folder using FindFiles(..) But it return all matched files from a path.
That is not be optimal if the folder has MANY files, And also you need to do the subfolder check in script. and issue new FindFiles call for each folder and walk down the folder tree.
It is possible but not optimal.
What is needed is a FindFirstFile that supports going down in subfolders.
I remember that I needed a script function like that for my self too.. so the next beta that will have FindFirstFileEx that support subfolders..