require('remote').require('shell').openItem('/');
Opens Finder but leaves it behind all other windows.
openItem
just opens the URI with default application, whether the default application takes focus depends on itself. In your case you should use showItemInFolder
.
@zcbenz I'm running into this same problem. I tried both openItem
and showItemInFolder
. Both of them ensure that the folder is open, but neither of them focus the folder window.
(That means you might click, say, "Open folder" in an electron app. It calls shell.openItem
or showItemInFolder
. Either way, the folder is still at the bottom of a stack of windows and the user thinks nothing happened.)
is it possible to add an option to openItem to make it foreground ? as it does help to open the directory instead of just show it in the parent folder which requires user one more click. @zcbenz