Use macOS API to open finder at given path

This commit is contained in:
Robin Gareus 2022-12-08 02:11:06 +01:00
parent 201617f03b
commit cd7c981e6e
2 changed files with 11 additions and 14 deletions

View file

@ -18,3 +18,12 @@ cocoa_open_url (const char* uri)
return ret;
}
bool
cocoa_open_folder (const char* path)
{
NSString* struri = [[NSString alloc] initWithUTF8String:path];
bool rv = [[NSWorkspace sharedWorkspace] selectFile:nil inFileViewerRootedAtPath:struri];
[struri release];
return rv;
}