[platform] more reliable way to reveal a file in Finder (IDEA-161700)

This commit is contained in:
Roman Shevchenko
2016-10-04 19:06:48 +02:00
parent e5055558ec
commit 80aba83adb
@@ -289,17 +289,8 @@ public class ShowFilePathAction extends AnAction {
}
if (SystemInfo.isMac) {
if (toSelect != null) {
final String script = String.format(
"tell application \"Finder\"\n" +
"\treveal {\"%s\"} as POSIX file\n" +
"\tactivate\n" +
"end tell", toSelect);
new GeneralCommandLine(ExecUtil.getOsascriptPath(), "-e", script).createProcess();
}
else {
new GeneralCommandLine("open", dir).createProcess();
}
GeneralCommandLine cmd = toSelect != null ? new GeneralCommandLine("open", "-R", toSelect) : new GeneralCommandLine("open", dir);
cmd.createProcess();
return;
}