I already talked about how to add a function to launch the IDE to the contact menu. I'll tell you again, but about VS Code.
Setting up the option occurs in two stages: setting a command for the terminal and creating automation.
Installing a command in the terminal
Open VS Code (in my case it's VS Code Insiders), press CMD+SHIFT+P
and type Shell
in the search.
Select the "Install command" option.
![](https://static.codex.so/upload/editor/69c86372c860f11f12d12f19f690e90e.png)
Now you can call the code
or code-insiders
command from the terminal to launch VS Code. The second parameter is the path to the directory we want to open.
$ code ~/dev/awesome-project
Creating an item in the context menu
Open the Automator application.
![](https://static.codex.so/upload/editor/2b6050a8687a37df3f572ea0ba445161.png)
Create "New Document" and select "Quick Action" type.
![](https://static.codex.so/upload/editor/c12d4e2514d198b3c2c6f681bda6c60d.png)
Set Workflow receive current "folders".
![](https://static.codex.so/upload/editor/16a7b468de9002d3ac85e6c8c3186c30.png)
Find and add a "Run Shell Script" step from the left list.
![](https://static.codex.so/upload/editor/f9e723398a8bd9554e5b48d0404bc4b9.png)
At the right top corner or step change Path input to "as arguments" value.
![](https://static.codex.so/upload/editor/6f6f653ad1f66ae1406632ef32babaf5.png)
After entering the command, you need to write the command itself that will be called and the argument.
It wasn't enough for me to specify code-insiders $1
. Because the launch gave an error that it could not find the command itself. Therefore, first we find the full path to the command in the terminal using whereis
.
talyguryn@mac ~ % whereis code-insiders
code-insiders: /usr/local/bin/code-insiders
In my case, the team became like this.
![](https://static.codex.so/upload/editor/fb5bbd555a60dd30a0bfcdb1022408c1.png)
Now all that remains is to save this action and give it a clear name.
![](https://static.codex.so/upload/editor/47fd4c861570402d801f7716b928a417.png)
Final result
Now you can open any directory directly in the editor in two clicks. Thanks for reading.
![](https://static.codex.so/upload/editor/08d818bc294f12c10ed2b5695096e6c6.png)