Re: Launching an App without NSWorkspace?
Re: Launching an App without NSWorkspace?
- Subject: Re: Launching an App without NSWorkspace?
- From: Mark de Jong <email@hidden>
- Date: Wed, 4 Sep 2002 21:50:36 -0700
We recently saw an AppleScript solution to mounting an ftp site.
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.
-- Mark
On Wednesday, September 4, 2002, at 09:09 PM, Isaac Sherman wrote:
on 9/4/02 11:39 PM, the method -(id)email@hidden:(id)
sender:@"Kurt
Revis"; returned:
Also, I think it's worth knowing about all the functionality available
in the system. There are some features in LaunchServices that you
can't
get elsewhere. The original poster didn't give enough detail to
determine whether the Launch Services stuff would be useful for him,
or
not.
I doubt that anything beyond what I asked for would be too helpful in
_this_
circumstance. All of the posts so far have been very helpful in
addressing
what I needed. For that, I thank all who have answered.
I just want the app to launch, or catch a signal if it's already
running.
Since I already have a way of knowing whether it's running (probably
non-standard, but simple enough), I just wanted to launch it.
However, I
believe it's important to know what's at my disposal, as well, so I'll
use
the Launch Services stuff this time. I'm sure it'll save me work in
the
future (as I seem to end up doing this task in varying ways, and will
probably want to do it again next tool).
Take care,
--
Isaac Sherman
MotaSoft Software
http://homepage.mac.com/huperzoevs/
_______________________________________________
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.
_______________________________________________
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.