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

Commit

Permalink
Use NSWorkspace's method for revealing in finder
Browse files Browse the repository at this point in the history
It is more reliable than applescript and works for Path Finder users as well
  • Loading branch information
Alex Zielenski committed Mar 31, 2013
1 parent 71aee85 commit b40bdcd
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions appshell/appshell_extensions_mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -604,11 +604,7 @@ - (void) timeoutTimer:(NSTimer*)timer

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

Expand Down

0 comments on commit b40bdcd

Please sign in to comment.