Based on Craig's answer, I found this very similar question that has a great solution using a bash script.
It works surprisingly well, at least for my needs.
The script is wrapped into an application, then the trick is to set up all the
jpg files (for example) to be open with this application by default.
This setup is easily done with the "Get Info" --> "Open with" --> "Change all" steps.
for f in "$@"
if [ $(dirname "$f") = "/Users/bob/Desktop" ]
open -a "/Applications/VLC.app" "$f"
open -a "/Applications/IINA.app" "$f"
(As you can notice, this script switch between the two players
INNA, but you can easily modify it to switch between
Preview. The folders can also can be easily modified to
/Users/bob/Project3/ instead of
Automator is actually not needed, as it's possible to turn a bash script into an application from the Terminal.
Still, if one prefer using Automator, it looks like this (from there you just run "File --> export" and save your application):