I wrote MyScript.sh! MyScript.sh works great from the command line; it takes one or more file paths as its arguments.
In Ubuntu 18.10 how can I:
- After selecting one or more files in Nautilus/Files.
- Trigger MyScript.sh using the selected file/files as arguments?
I am happy to use either a contextual menu (i.e. right click), or a keyboard shortcut (.e. through Settings > Keyboard > Custom Shortcuts).
Unacceptable answer: I am not looking for someone to tell me to type ./MyScript.sh
in the command in a terminal, and then drag-and-drop a file/files onto it from nautilus followed by <ENTER>
.
Edit 1: I have tried placing MyScript.sh in ~/.local/share/nautilus/scripts/, ensuring it is executable, and right clicking on a file to apply, but no Script submenu appears.
Edit 2: I have set a Keyboard Shortcut in Settings > Keyboard, but the script does not execute.
$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS
in to array and then manipulate it. Here are few other answers of mine, that I think are good examples: https://askubuntu.com/search?q=user:566421+[nautilus-script] – pa4080 Feb 01 '19 at 10:19