2

How can I right click on a project folder and open in VS code or another editor via the context menu? The question had a post on stack before which I referred to for previous computer setups but seems to have since been deleted. Thanks!

0

2 Answers 2

6

I figured it out.

Open up Automator. ( It comes standard in osx ). It'll promp you to select a type. Click on Quick action. Now select Folders in finder. In the search bar, search for Apple Script, and drag and drop it into the screen on the right. Next, type in the applescript to match the photo.

on run {input, parameters} tell application "Visual Studio Code" activate open (first item of input) as text end tell end run 

Save it and call it whatever you like. I named it 'Open in VS Code'. I believe what you name it is how it will appear. you can also choose your own icon.

Entirely optional but you can also create your own hotkey binding if you like by going to System Settings/Preferences > Keyboard > Keyboard Shortcuts > Services > Files and Folders > and ensuring that 'Open in VS Code' is checked. then to assign a key binding, click on the none to the right and type in your key binding.

Now right click on any project folder, click on quick actions. and enjoy your new Shortcut!

Sign up to request clarification or add additional context in comments.

1 Comment

Updated 2/21/24: Visuals changed a bit. 1. File>New. (Quick Action)> choose. 2.Under Library click on utilities. 3.in the second column, drag: "run AppleScript" to the right section. Up top, select: folders in Finder. select an image icon. copy and paste into the AppleScript space: on run {input, parameters} tell application "Xcode" // choose your editor's name activate open (first item of input) as text end tell end run. File > save. (Save it as the shortcut text you want to click on. It should now show up. Right click > Quick Actions > Open In Xcode
0

You can use a shortcut like this

click here to view

1 Comment

Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.