Use Dispatch to "get file" of entire folder

Hello,

I am having trouble getting the Dispatch tool to get all the files in a folder and its subfolders. I can get to to work with the selected path and for all documents, but I would like to to get this folder when any file is selected in the vault. I can create a parameter file of the file paths, but then how do I take each file path to the get file function?

Thanks,

Carl

SolidworksSolidworks Pdm enterprise Pdm