• 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
Detecting whether app at path is running?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Detecting whether app at path is running?


  • Subject: Detecting whether app at path is running?
  • From: Matt Gemmell <email@hidden>
  • Date: Sat, 25 May 2002 22:32:09 +0100

Hi all,

I have two questions relating to running applications. Hopefully someone
can help out!

1. Is NSFileManager's -isExecutableFileAtPath: method sufficient to
determine whether the file at that path is an *application*? That is, to
determine reliably whether it's a Classic, Carbon or Cocoa app (it
doesn't matter which it is; I just need to know that it *is* an
application). I suspect that it would also return true for executable
files in /usr/bin and so forth, which I wouldn't classify as
applications in the traditional sense. If not, is there a way to make
this determination is some kind of reasonably accurate way?

(By the way, I noticed NSWorkspace's -getInfoForFile:application:type:
method, but the valid types explicitly mention only Cocoa applications.)


2. Given the path to an item, and assuming we've already determined that
that item is indeed an application, how would I go about determining if
that application is currently running?

To give some background, I have a need to implement the kind of
functionality which the little black triangles in the Dock provide; a
visual indicator as to whether a given app is currently running. I'm
aware that I can register to receive notifications when apps are
launched and terminated, but those are only useful once my app is
running - I still need to make a determination at my app's launch time
of which apps are *already* running, so that the initial display is
accurate.

Any thoughts on this would be much appreciated. My needs are very
simple; I literally only need to know if the app at a given path is
running or not - I'm not trying to interfere with other apps in any way.
:)

Best,
-Matt

--
Matt Gemmell
Scotland Software
<http://www.scotlandsoftware.com/>
_______________________________________________
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: Newbie NSPopUpButton addItemWithTitle: problem from a menu
  • Next by Date: Re: Adding <NSCoding> to NSTextStorage, or not.
  • Previous by thread: Subclassing NSDocumentController & Finder
  • Next by thread: Re: Detecting whether app at path is running?
  • Index(es):
    • Date
    • Thread