Standard file open/app launch commands for Mac, Win, and X11
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.tcl archive

Standard file open/app launch commands for Mac, Win, and X11

From: Kevin Walzer <kw@kevin-walzer.com>
Date: Sat Apr 29 2006 - 17:29:27 CEST

I'm developing a list of platform-specific file open/application launch
commands for use in my Tcl programs. The idea is that these commands
invoke the platform-specific API for managing a user's default
applications for specific file extensions and mimetypes; Tcl can just
hand that task off to the system command.

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
Received on Sun Apr 30 03:31:41 2006