-
Open Automator
-
Create a new document
-
Select Quick Action
-
Set “Service receives selected” to
files or folders
inany application
-
Add a
Run Shell Script
action- your default shell should already be selected, otherwise use
/bin/zsh
for macOS 10.15 (”Catalina”) or later - older versions of macOS use
/bin/bash
- if you're using something else, you probably know what to do 😉
- your default shell should already be selected, otherwise use
-
Set the script action to the following
for f in "$@"; do open -a 'Visual Studio Code' "$@" done
-
Set “Pass input” to
as arguments
-
Save as
Open in Visual Studio Code
You can assign a global shortcut to run the services we just created
- Open “System Preferences”
- Select “Keyboard” then the “Shortcuts” tab
- In the left pane, click on “Services”
- In the right pane, scroll to “Files and Folders”
- Select “Open in Visual Studio Code” click “add shortcut”
- Select a shortcut
You might want to rename or edit the items we just created
- Activate Finder
- Click on “Finder” in the Apple menu, select “Services” then “Services Preferences”
- In the right pane, scroll to “Files and Folders” and scroll to the item you want to edit
- Right click the item and select “Open in Visual Studio Code”
- Edit and save
Alternatively, you can edit the workflow (e.g. ~/Library/Services/Open in Visual Studio Code.workflow
) in your preferred text editor
you can customize the touch bar to include a quick action button![image](https://private-user-images.githubusercontent.com/3666980/335436539-876db8a8-9a80-4e7e-8bee-8ecc3c1f2f30.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE3MTY1MjIsIm5iZiI6MTcyMTcxNjIyMiwicGF0aCI6Ii8zNjY2OTgwLzMzNTQzNjUzOS04NzZkYjhhOC05YTgwLTRlN2UtOGJlZS04ZWNjM2MxZjJmMzAucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcyMyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MjNUMDYzMDIyWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NDRlZjQ5MDVlMWNlZDg4OThlNDJkNzY3YjBlYThjMmY4MmYzY2YxODk0ZjkzYzM4YWE4ZmExYmUwNjhkMDc2MiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.Z1dGR7hb7SCBAsdc7cEHbUg6prQfaLgKrsgzBZ_4boM)
once you tap it, the Open in Visual Studio Code option should be there.