• 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: launching standard apps with NSTask
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: launching standard apps with NSTask


  • Subject: Re: launching standard apps with NSTask
  • From: Adam Leonard <email@hidden>
  • Date: Tue, 10 Jun 2008 17:20:21 -0700

LaunchServices or NSWorkspace (which uses LS) is still probably your best option, as NSTask is not really designed to deal with GUI apps.

To terminate the app, you can send a quit apple event or use applescript. This has come up recently, so search the list archives.

To detect when the user terminates the application, you can also use NSWorkspace. See the documentation for NSWorkspaceDidTerminateApplicationNotification


Adam Leonard


On Jun 10, 2008, at 4:22 PM, Memo Akten wrote:

Hi, that looks great thanks, I've just been looking through the documentation, but I don't think it allows control over terminating the app, or detecting when its closed. I would like to have that level of control (just terminate, and detect if user close it) - which is why I was opting for NSTask - but actually I'm not having any luck with that either! (if I put the path to the .app I get a permission error, if I put the path to the file in contents/macos it doesn't work!). is there anything else I can do?

Memo (Mehmet S. Akten)

www.memo.tv

email@hidden



On 11 Jun 2008, at 00:02, Michael Vannorsdel wrote:

[[NSWorkspace sharedWorkspace] launchApplication:@"Safari"];


On Jun 10, 2008, at 4:55 PM, Memo Akten wrote:

Hi all, i'm writing an app that launches some default apps like safari, itunes, iphoto etc using NSTask. I was wondering if there is a way of writing the launch url not fully hardcoded but using some system variables / methods etc.?

Memo (Mehmet S. Akten)

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: launching standard apps with NSTask
      • From: Memo Akten <email@hidden>
References: 
 >launching standard apps with NSTask (From: Memo Akten <email@hidden>)
 >Re: launching standard apps with NSTask (From: Michael Vannorsdel <email@hidden>)
 >Re: launching standard apps with NSTask (From: Memo Akten <email@hidden>)

  • Prev by Date: Re: creating and using a View xib
  • Next by Date: Re: A simple doubt about array
  • Previous by thread: Re: launching standard apps with NSTask
  • Next by thread: Re: launching standard apps with NSTask
  • Index(es):
    • Date
    • Thread