How to get filename in shell script?

Hi,

I would like to execute a shell script on a right-click on a file and after selecting the context menu item. I need to get the filename of the selected file. $1 does not work and I also could not find any hint in the documentation.

Does somebody have an idea how to get the filename?

Best regards

I switched to automator. There is a simple way to access the filename.

1 Like

Yep, that would have been my suggestion as well, either use Automator or Shortcuts. Shortcuts makes working with files also pretty simple.
You can then trigger any of these via BTT.