• 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 an App without NSWorkspace?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Launching an App without NSWorkspace?


  • Subject: Re: Launching an App without NSWorkspace?
  • From: Mark de Jong <email@hidden>
  • Date: Thu, 5 Sep 2002 07:19:51 -0700

Hmm ... what kinds of errors are returned? I just tried to generate errors, and got none.

If the app doesn't exist or cannot be found, a dialog appears asking for it.
If the script has errors in it, it simply fails.

However, the "theErrors" dictionary remains empty.

So, if "theErrors" doesn't help, then you're right. Just point it to "nil" and forget about it.

-- Mark

On Thursday, September 5, 2002, at 05:08 AM, Rosyna wrote:

<some app> must be known by LaunchServices when you run this script or else it will not function as you hoped. The standard is to ask the user for the path to the app at this point.

And why not NSDictionary* theError=NULL; then later no [theError release]; ?

Ack, at 9/4/02, Mark de Jong said:

As a different approach, you could use AppleScript to launch an app. So, starting with Mark Steinberg's code, we make some simple modifications as follows:

NSAppleScript *theScript = [[NSAppleScript alloc] initWithSource:@"tell application \"<some app>\" to activate\r"];
NSDictionary *theError = [[NSDictionary alloc] init];
[theScript executeAndReturnError: &theError]; //Probably a good idea to check for errors
[theScript release];
[theError release];

and "<some app>" should launch. My tests show that this works.

--


Sincerely,
Rosyna Keller
Technical Support/Holy Knight/Always needs a hug

Unsanity: Unsane Tools for Insanely Great People
---

Please include any previous correspondence in replies, it helps me remember what we were talking about. Thanks.
_______________________________________________
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.

References: 
 >Re: Launching an App without NSWorkspace? (From: Rosyna <email@hidden>)

  • Prev by Date: Re: if statements vs. switch
  • Next by Date: ANN: Pantomime 1.0.5
  • Previous by thread: Re: Launching an App without NSWorkspace?
  • Next by thread: Re: Launching an App without NSWorkspace?
  • Index(es):
    • Date
    • Thread