|Aug 20, 2009, 09:46 AM||#1|
NSWorkSpace open File
I am using Cocoa with Obj C.
I am using the following method to open a file associated with a particular application.
[[NSWorkspace sharedWorkspace] openFile:<some file path>]
If the file is not associated with any application, I want the user to select the application also with which the file has to be opened. In the following code we have to tell which application it has to open.
[[NSWorkspace sharedWorkspace] openFile:< some file path> withApplication:@"TextEdit"]
|Aug 20, 2009, 10:57 AM||#2|
You can probably use LSCopyApplicationURLsForURL() (or one of the other Launch Services functions) to determine if there already is a default app to open it. If that returns empty, use NSOpenPanel to let the user select an app.
|Thread Tools||Search this Thread|
|thread||Thread Starter||Forum||Replies||Last Post|
|OS X Lion Opening Previously Opened Files||US Marine||Mac Basics and Help||3||Sep 28, 2011 08:35 PM|
|Is There an "Always Open With" feature to change default applications for 9.2.2 files||In-Correct||PowerPC Macs||2||Aug 8, 2011 10:24 AM|
|Annoying File Open Issue||Super_Saxy||Mac OS X||3||Jan 8, 2011 01:44 PM|
|Photoshop Help Please! "Cannot Open File Because File Is Empty||ipodtouchy333||Mac Applications and Mac App Store||2||Mar 21, 2010 09:50 AM|
|Opening files in OSX - opens VMware Fusion||dave1609||Mac Applications and Mac App Store||1||Oct 18, 2008 09:40 AM|
All times are GMT -5. The time now is 04:06 AM.