Here's what I've got so far:
OS X: exec open myphoto.jpg; exec open http://wiki.tcl.tk
Windows: eval exec [auto_execok start] myphoto.jpg; eval exec
[auto_execok start] http://wiki.tcl.tk
Linux/Unix (Gnome): exec gnome-open myphoto.jpg; exec gnome-open
http://wiki.tcl.tk
Linux/Unix (KDE): exec "kfmclient exec myphoto.jpg"; exec "kfmclient
exec http://wiki.tcl.tk"
Linux/Unix (other): tk_getOpenFile ("Please choose the program to open
this file":)
Two questions:
1. Are these the right commands to use, particularly on Linux, or are
there others (kstart?).
2. Am I missing anything major from the X11 world, i.e. other desktop
environments that have an API/system command for launching applications?
If so, can anyone point me in the right direction?
Thanks.
--
Kevin Walzer
Poetic Code
http://www.kevin-walzer.com
Kevin Walzer writes:
> Windows: eval exec [auto_execok start] myphoto.jpg; [...]
That should be
eval exec [auto_execok start] [list "" "my photo.jpg"]
a) You need a "" for the "title" argument to START (check out
START/?). Otherwise, when the first argument is quoted, START will
treat that as a title. And the filename will be quoted when it
contains spaces. This is on NT/W2K, I don't know about W9x/Me.
b) You need [list] to offset the [eval] when your you do a) and/or
when your filename contains spaces.
> eval exec [auto_execok start] http://wiki.tcl.tk
See also <http://wiki.tcl.tk/557>.
The easiest on Windows is probably to write or re-use a binary
extension that wraps the ShellExecute API, like the one on
e.g. <http://wiki.tcl.tk/13925>.
> Linux/Unix (Gnome): exec gnome-open myphoto.jpg; exec gnome-open
> http://wiki.tcl.tk
>
> Linux/Unix (KDE): exec "kfmclient exec myphoto.jpg"; exec "kfmclient
> exec http://wiki.tcl.tk"
>
> Linux/Unix (other): tk_getOpenFile ("Please choose the program to open
> this file":)
You might want to look at what the Portland project plans with their
"xdg-utils" <http://portland.freedesktop.org>. They cover the same
ground here.
benny