Here is how to create your own “Open with…” right-click menu item under MacOS’s “Quick Actions” menu:
- Open the Automator app on your Mac
- Choose “New Document” -> “Quick Action”
- On the left-hand column, search for “Run Shell Script” and add it to the workflow on the right.
- For the shell script, you’ll want to enter the following text:
"/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code" "$1"
- Change the “Pass Input” drop-down to “as arguments”
- At the top of the workflow parameters, change “Workflow receives current” to “files or folders” and in “Finder”.
- You can change the image icon to whatever you want.
- File -> Save -> “Open with VS Code” (hint: the filename you save this as will reflect how it shows up on the Finder contextual menu)
- Save in the default path, prompted by Automator.
- All done! You can now access your new custom action by right-clicking on a file or folder in the Finder.
Side note: You need VS Code installed on your Mac (if that wasn’t obvious).
Here’s what the Automator configuration window ought to look like:
Here is how you can access the “Quick Actions” from the Finder contextual menu: