[Openmcl-devel] launch app
Gary Byers
gb at clozure.com
Tue May 5 03:25:27 PDT 2009
The class that handles this sort of thing is NSWorkspace; like some
other classes, there's a single, global instance (accessible via
#/sharedWorkspace).
When you searched for methods whose name contained the string "launch"
in AppKido, did you find this ? (Or did you forget that AppKido has a
search function ? Or ...)
? (#/launchApplication: (#/sharedWorkSpace ns:ns-workspace) #@"Safari")
T
? (#/launchApplication: (#/sharedWorkspace ns:ns-workspace) #@"Bogus-application")
NIL
It seems that a lot of NSWorkspace methods only work in a "real"
standalone .app (e.g., they don't work if you just do (require
"COCOA")).
Cocoa's huge. The good news is that you don't have to learn all of it
(or even much of it) before doing anything. More good news: there are
tools (including AppKido) that can help you to find what you're
looking for.
I didn't remember the name of the #/launchApplication: method (I think
that I remembered that there were NSWorkspace methods that did this
sort of thing) and had to look it up. If you don't know that sort of
thing (have a pretty good idea of what class might support the
functionality you're looking for), you might have to try other, broader
approaches (like searching for "launch" and ignoring results that prove
to be irrelevant.) That may seem like a lot of effort to go to to
find a simple answer to a simple question, but a side-effect of that
effort is that your model of how Cocoa is organized starts to get more
complete (as you encounter more classes and methods and learn a little
bit about them) and it starts to get easier to find things. (In other
words, that effort is rewarded.)
If you have questions about using Cocoa from CCL, it's certainly
appropriate to ask them on this list. If you have questions about
Cocoa that aren't really CCL-specific - like "what method does ___ ?"
or "what does the method ___ do ?", there are probably better ways of
getting answers (where "better" means, among other things, "makes better
use of the time of everyone concerned.")
On Tue, 5 May 2009, Joakim Sandgren wrote:
> in mcl I used:
> (#_lsopenfsref (ccl::make-fsref-from-path path) (%null-ptr))
> to launch an application in the finder.
> how do I do this in clozure ccl?
>
> SIncerely
>
> Joakim
>
>
>
> Joakim Sandgren
> joakim sandgren musik
> 42, rue de Maubeuge
> 75009 Paris
> France
> +33 (0)1 45 26 43 90
> info at joakimsandgren.com
> http://www.joakimsandgren.com
>
>
More information about the Openmcl-devel
mailing list