Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Standard file open/app launch commands for Mac, Win, and X11
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Kevin Walzer  
View profile  
 More options Apr 29 2006, 11:29 am
Newsgroups: comp.lang.tcl
From: Kevin Walzer <k...@kevin-walzer.com>
Date: Sat, 29 Apr 2006 11:29:27 -0400
Local: Sat, Apr 29 2006 11:29 am
Subject: Standard file open/app launch commands for Mac, Win, and X11
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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Benjamin Riefenstahl  
View profile  
 More options Apr 29 2006, 12:39 pm
Newsgroups: comp.lang.tcl
From: Benjamin Riefenstahl <b.riefenst...@turtle-trading.net>
Date: Sat, 29 Apr 2006 18:39:04 +0200
Local: Sat, Apr 29 2006 12:39 pm
Subject: Re: Standard file open/app launch commands for Mac, Win, and X11
Hi Kevin,

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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »