Is there a Mac OS X "open" command equivalent that can be called from C ++ / Objective-C code?
1 answer
This is done with NSWorkspace
. See -[NSWorkspace openFile:]
. All you have to do is
[[NSWorkspace sharedWorkspace] openFile:@"file.txt"]
If you need more fine-grained control (for example, getting all the applications that can open a given file) you use Launch Services. See document and reference .
+4
a source to share