Is it possible to add a service to a folder so as to open it with a specific application?
As shown in the screenshot below, an application named Evernote has done this. I want to do it manually for VS Code and Brackets.
Let's take VS Code for an example. It is a text editor that opens a folder in it and allows a user to edit the text files in the folder and its subfolders. There are so many other applications in the market like Sublime, Adobe Brackets and so on.
The folder hierarchy looks like this:
In order to open the folder in the app, I have to open the app, then go to the open folder option, then find the folder, then select and click on the open button.
Instead of this, I want an option in the right click menu of the folder to open the folder directly with the text editor. Just like you can open a folder in Terminal by adding a service.
Best Answer
You can do this with an Automator Service.
Create the Service:
Open Automator and select Service or File > New > Service If Automator is already open.
Set Service receives selected to files or folders and in to Finder.
Add a Run Shell Script Action, setting Shell: to /bin/bash and Pass input: to as arguments and add the following code:
You can now select Files and or Folders in Finder and then control-click (right-click) on them and select Open in Visual Studio Code from the Services Context Menu.
Note: I tested this with Visual Studio Code but not with Brackets as I don't have it installed. However you should be able to create one for it too in the same manner while substituting the application's name in the
open
command.