I have set 'always open with' to : 'Iterm2', for .sh files in osX.
Although a double click on a shell script now opens a new Iterm window, the script does not actually run, I just the get the empty prompt.
There might be an applescript solution, but I would prefer a more direct way.
How to launch .sh scripts from the finder in iTerm2 instead of Terminal
command linefinderiterm
Related Question
- How to link/call an actual shell script saved within an Applescript app
- MacOS – AppleScript executes itself again after a reboot it initiated. How to avoid that
- Changing user prompt terminal
- How to write a script that opens an iTerm2 window and runs a command
- MacOS – How to control the Terminal in the current space with AppleScript
- How to make sudo in 2 tabs ask for the password only once
Best Answer
It works for me but only if the file is executable. For example this runs
a.sh
in a new window:If you want it to work with non-executable files, set an application like this as the default application for
.sh
files: