PhpStorm has a command-line interface that you can install using the Tool Box, but did you know that you can also use the finder?
Normally I’d just drag a folder into the app icon in the dock, and I guess that’s fine.
But it’s also sometimes awkward on a dual monitor setup or when you’re using the trackpad.
To get started, open Automator.app and choose “New Document“.
Then choose Quick action, now search for for and add the Run Shell Script action by double clicking or dragging it.
In the Run Shell Script action Set Pass input to as arguments.
Now we can add the following for PhpStorm
for f in "$@"; do
open -a 'PhpStorm' "$@"
done
And this one’s for you if you’re a Visual Studio Code user.
for f in "$@"; do
open -a 'Visual Studio Code' "$@"
done
Save as the automation accordingly “Open in PhpStorm“.
Now, if you right click on any files or folders, you should see the Quick Action Open in PhpStorm.
