• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Opening files in external applications
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Opening files in external applications


  • Subject: Re: Opening files in external applications
  • From: Kirk Kerekes <email@hidden>
  • Date: Sun, 4 Aug 2002 12:28:56 -0500

Try NSWorkspace's

- (BOOL) openFile:(NSString *)fullPath

("Opens the file specified by fullPath using the default application for its type; returns YES if the file was successfully opened, NO otherwise. The sending application is deactivated before the request is sent.")

and/or

- (BOOL) openURL:(NSURL *)url

(which works just like openFile: except it expects an NSURL)


Message: 9
Date: Sun, 04 Aug 2002 11:25:59 -0400
Subject: Opening files in external applications
From: David Feldman <email@hidden>
To: Cocoa Dev <email@hidden>

I have a Cocoa app from which I want to open some Web pages in the user's
default browser, as well as a text file in the default app for that
(presumably TextEdit on most systems). So far the only way I can see to do
this is to use a system() call to the command-line open command and store
the URLs as weblocs. Is there a more elegant way?

Thanks,
--Dave
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: Can't pipe files to compileHelp
  • Next by Date: Wring code without interface builder
  • Previous by thread: Opening files in external applications
  • Next by thread: [NSBezierPath appendBezierPathWithGlyphs] broken in 10.2?
  • Index(es):
    • Date
    • Thread