Making {filepath} work recursively


I am new to Opus scripting. I'm trying to use {filepath} to pass all the files recursively within a selected folder to an external command.

I want to be able to select one folder in a lister and have all the files in all subfolders of that folder have their full paths passed to my command. I know I could go to flat view and select all the files that way, or carry out a manual search/filter first to select them, but is there a way to simply select the top level folder and have all files below that passed to my command?

There are a couple of ways you can do this, possibly involving some (short, simple) scripting.

It depends slightly on how the command works, and how many files might be involved.

Does the command need every file listed on a single command line? If so, can it also accept a list of files in a text file, as some can? (That can help with command-line length limits and a large number of files.)

Or does the command need to be run one for each file?

(Please also link your account.)

The command accepts one file only on the command line so it needs to be run once for each file. The number of files to be processed is probably around 1000-2000 and the directory structure is about 10 levels deep max.