Skip to content

Instantly share code, notes, and snippets.

@ludoo0d0a
Last active April 20, 2023 06:14
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ludoo0d0a/be23757d5d9f8c2511baf042fea80cc3 to your computer and use it in GitHub Desktop.
Save ludoo0d0a/be23757d5d9f8c2511baf042fea80cc3 to your computer and use it in GitHub Desktop.
Open folder into IntelliJ from MacOs Finder
# How to oget an icon to easily open folder into IntelliJ from MacOs Finder
Use tools made with Automator (better, faster, stronger...) :
https://github.com/ludoo0d0a/open-in-buttons-for-finder-toolbar
:)
# Here is the old deprecated way :
(Multiple finder or multiple idea projects works badly)
## Create scripts
in IntelliJ, go to
> Tools / Create command-line launcher
OR
if you installed "Jetbrains toolbox"
> Generate shell scripts, and set a path to store your scripts
## Update scripts
Generated scripts should be updated to properly get finder path (thx to @n1kk https://medium.com/@n1kk/how-to-add-console-here-button-to-finder-toolbar-or-any-other-action-button-84dae9c34891).
Turn this :
```sh
#open -a "/Users/ludoo/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/191.7479.19/IntelliJ IDEA.app/Contents/MacOS/idea" "$@"
```
into:
```sh
finderPath=`osascript -e 'tell application "Finder" to get the POSIX path of (target of front window as alias)'`
IDEA="~/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/191.7479.19/IntelliJ IDEA.app/Contents/MacOS/idea"
open -a "$IDEA" "$finderPath"
```
## Icon
We need a nice icon
Open finder in your scripts folder.
Change icon of the script file by opening "Properties panel" ,icon will be on the top left of panel.
Find IntelliJ original executable with the proper icon, and drag/drop it into ths icon of panel.
Icon will be replaced.
## finder toolbar
But we need a icon to click.
Open finder in your scripts folder.
Drag and drop idea script, while pressing the (cmd) key, onto the finder toolbar.
Choose a place and the icon will stay.
That's all, when you click on your marvelous icon in your finder, IntellI will open a new window for this folder.
Have fun !
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment