on
New-File & Open-in-Terminal context menu with BetterTouchTool
Previously many small applications tried to provide essential Finder context menus such New File & Open-in-Terminal. These are,
Custom-Finder-Right-Click-Menu
Context-menu (may not work now)
Most of them either do not work with latest mac, or requires compiling for apple silicon.
However now, starting with BetterTouchTool v4.560 you can extend the Finder context menu with custom menu items very easily. You can even add monochrome system icons.
New-File:
The setup is done in the “Automations & Named & Other Triggers” section in BTT by adding a “Custom Finder Context Menu Items” trigger and assigning the Configure Custom Conntext Menu Items” action.
When context menu item is triggered, BTT will make these variables available that can be used e.g. in terminal commands or scripts:
- BTTFinderContextMenuTargetPath (the path of the current folder)
- BTTFinderContextMenuSelectedItemPaths (the paths of the selected items, separated by ;; )
We will take advantage of that with simple one line bash script to create multiple new file like in Gnome Nautilus.
1
filePath="{BTTFinderContextMenuTargetPath}/untitled";fileNo=1;while [ -f "${filePath}" ];do filePath="{BTTFinderContextMenuTargetPath}/untitled${fileNo}";fileNo=$((fileNo+1));done;touch "${filePath}"
Open-in-Terminal:
Open in Terminal is as simple as selecting “Open selected/Active folder with specific app” and then choosing default terminal app.
Discussion and feedback