Skip to content
This repository was archived by the owner on Sep 2, 2021. It is now read-only.

Commit b40bdcd

Browse files
author
Alex Zielenski
committed
Use NSWorkspace's method for revealing in finder
It is more reliable than applescript and works for Path Finder users as well
1 parent 71aee85 commit b40bdcd

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

appshell/appshell_extensions_mac.mm

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -604,11 +604,7 @@ - (void) timeoutTimer:(NSTimer*)timer
604604

605605
int32 ShowFolderInOSWindow(ExtensionString pathname)
606606
{
607-
NSString* scriptString = [NSString stringWithFormat: @"activate application \"Finder\"\n tell application \"Finder\" to open posix file \"%s\"", pathname.c_str()];
608-
NSAppleScript* script = [[NSAppleScript alloc] initWithSource: scriptString];
609-
NSDictionary* errorDict = nil;
610-
[script executeAndReturnError: &errorDict];
611-
[script release];
607+
[[NSWorkspace sharedWorkspace] activateFileViewerSelectingURLs:[NSArray arrayWithObject: [NSURL fileURLWithPath: pathname.c_str()]]];
612608
return NO_ERROR;
613609
}
614610

0 commit comments

Comments
 (0)