• 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
Problem getting the launch identifier
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem getting the launch identifier


  • Subject: Problem getting the launch identifier
  • From: Craig Altenburg <email@hidden>
  • Date: Thu, 25 May 2006 16:00:28 -0400

I am trying to launch a faceless, background-only application and get back the launch identifier using:

NSNumber * launchIdentifier = nil;
BOOL launchOK = [ [ NSWorkspace sharedWorkspace ] launchAppWithBundleIdentifier: @"com.mindwrap.scripthelper"
options: 0
additionalEventParamDescriptor: nil
launchIdentifier: &launchIdentifier ];
NSLog( @"launchIdentifier = %@", launchIdentifier );


The requested application IS launched but the method call fails with an NSRangeExcption:

    *** -[NSCFArray objectAtIndex:]: index (0) beyond bounds (0)

The "NSLog" statement is not reached.

Oddly, if I pass nil in the launchIdentifier parameter the code works (but, of course, does not return the launch identifier).

Is there some magic that I'm overlooking here?

I'm using XCode 2.3 on OS X 10.4.6 (intel).

Things I've tried that did not help:
* passing [ NSAppleEventDescriptor nullDescriptor ] as the additionalEventParamDescriptor
* initializing the launchIdentifier variable with an NSNumber object
* setting options to: NSWorkspaceLaunchWithoutActivation
* consulting my crystal ball or ouija mouse pad


_______________________________________________
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


  • Follow-Ups:
    • Re: Problem getting the launch identifier
      • From: Mike Blaguszewski <email@hidden>
    • Re: Problem getting the launch identifier
      • From: Nick Zitzmann <email@hidden>
References: 
 >setState has no effect on an NSButton with value binding? (From: George Orthwein <email@hidden>)
 >Re: setState has no effect on an NSButton with value binding? (From: mmalcolm crawford <email@hidden>)
 >Re: setState has no effect on an NSButton with value binding? (From: George Orthwein <email@hidden>)

  • Prev by Date: Re: inconsistant AppleScript
  • Next by Date: Re: Problem getting the launch identifier
  • Previous by thread: Re: setState has no effect on an NSButton with value binding?
  • Next by thread: Re: Problem getting the launch identifier
  • Index(es):
    • Date
    • Thread