Page 1 of 1
open a file in the default web browser
Posted: Tue Dec 09, 2008 5:30 pm
by cormullion
I've written this for running on MacOS X:
Code: Select all
(if (= ostype "OSX")
(exec (string "open " file ".html")))
which displays the file.html file in the default web browser. Is there an equivalent form for other Unixes, or is 'open' standard?
Posted: Tue Dec 09, 2008 6:16 pm
by newdep
Under unix/linux you dont have bindings to a file extention on OS basis,
though some window managers like XFCE, KDE or GNOME can do that its this,
but because of a newlisp execute it wont work, i think...
(i dont use eighter of them so i cant test it..)
You have to explicit execute the webbrowser the user is using for this...
Under windows you might have more luck because that can bind to file
extentions, but also there..its executed from within newlisp so i dot know
the outcome...
Posted: Tue Dec 09, 2008 7:37 pm
by DrDave
newdep wrote:
Under windows you might have more luck because that can bind to file
extentions, but also there..its executed from within newlisp so i dot know
the outcome...
In windows, you associate file extensions with an application to enable launching the application and opening the file by double clicking the file name. I think when you install the OS that it has default association of .html and .htm to Internet Explorer. However, the user can change it to any other application, or even remove any associations. If removed, when the file is double clicked, a dialog opens rather than an application launching.