• 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: Forcing an application into the foreground
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Forcing an application into the foreground


  • Subject: Re: Forcing an application into the foreground
  • From: John Stiles <email@hidden>
  • Date: Wed, 2 Mar 2005 14:32:53 -0800

On Mar 2, 2005, at 2:29 PM, Finlay Dobbie wrote:

On Wed, 2 Mar 2005 14:08:58 -0800, John Stiles <email@hidden> wrote:
Another poster suggested using "open /whatever/YourApp.app", and this
will probably work too because open calls Launch Services internally.
However, using NSWorkspace is only one or two lines of code, and
probably has fewer goofy side effects. (i.e. someone could construct an
app name that will generate problems for your synthesized command
line.)

Actually, open uses NSWorkspace ;-) Also, using NSWorkspace or Launch Services from a daemon can certainly have oodles of goofy side effects, since doesn't it connect you to the window server?

Oh jeez, this is for a daemon?
I guess your best bet is to fork off to a BSD process which opens the app itself. So relying on "open" really is the right choice. Just be real careful about escaping that filename! Quotes, spaces, slashes, hyphens, Japanese characters, etc. can all appear in filenames.


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Forcing an application into the foreground (From: Sarah Dumoulin <email@hidden>)
 >Re: Forcing an application into the foreground (From: John Stiles <email@hidden>)
 >Re: Forcing an application into the foreground (From: Finlay Dobbie <email@hidden>)

  • Prev by Date: Re: Forcing an application into the foreground
  • Next by Date: Re: Forcing an application into the foreground
  • Previous by thread: Re: Forcing an application into the foreground
  • Next by thread: Re: Forcing an application into the foreground
  • Index(es):
    • Date
    • Thread