Okay, so I’m not sure where the Get Specified Finder Files comes into this then. It sounds like you are always working from a specific folder. Therefore, you should just be able to change the path specified for theFolder
to specify where the files are that you want to process. Do wrap in double quotes for any spaces, etc.
No, it just won’t look in those sub folders as is - just the folder you specify. To incorporate sub folders, you would need to set the listing to be recursive and remove blank entries.
Try setting the line that sets the value of theFile
to the following.
theFile=$(ls -p -R $theFolder | grep -v / | grep -v -e '^$' | sort --random-sort | head -n 1)
This includes changes to do both of those things mentioned above.
Hope that helps.