Electron: `shell.openItem` does not move Finder to the top on OS X

Created on 20 Jul 2015  ·  3Comments  ·  Source: electron/electron

require('remote').require('shell').openItem('/');

Opens Finder but leaves it behind all other windows.

All 3 comments

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

Was this page helpful?
0 / 5 - 0 ratings