The first does not work because Thunar actions seem to call the command with
bashand makes the use of
The second does not work when the selection is a directory because the current directory is then one level up. So you need to first
cdinto the target before running the command.
So, if the <command> works in a terminal window opened in a target directory, in order to make that work as a Thunar custom action for the same directory, adapt the command as follows:
cd %f &&<command>