MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: open URL programmatically?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg85608] Re: open URL programmatically?
  • From: David Reiss <dbreiss at gmail.com>
  • Date: Thu, 14 Feb 2008 18:52:01 -0500 (EST)
  • References: <fopa2k$ahc$1@smc.vnet.net> <200802130913.EAA21519@smc.vnet.net>

It's just something that I know and which I use in the function
OpenFileOrDirectory in http://scientificarts.com/worklife  (the full
function OpenFileOrDirectory requires some finesse to make it work for
files and directories in a way that is independent of the operating
system, however for URLs it is generally fine to use what I pointed
out to this newsgroup.)  Presumably I learned about this syntax at
some point by reverse engineering something...

?OpenFileOrDirectory

OpenFileOrDirectory["fileOrDirectoryName"] opens the file or \
directory given by the string fileOrDirectoryName. If \
fileOrDirectoryName is not a notebook or other Mathematica object, it \
will open in the appropriate application for its file type.  If \
fileOrDirectoryName is an application then that application will be \
launched. If fileOrDirectoryName is a web URL then that URL will be \
opened in your default browser. (Note that the function \
OpenURLInBrowser is the more direct way to do this in the case of a \
URL rather than a file on your local file system.)  >>

--David
A WorkLife FrameWork
E x t e n d i n g MATHEMATICA's Reach...
http://scientificarts.com/worklife/


On Feb 14, 1:12=A0am, Murray Eisenberg <mur... at math.umass.edu> wrote:
> How did you discover that, since the Documentation Center does not seem
> to say anything about it (unless I missed it)?
>
>
>
> David Reiss wrote:
> > FrontEndExecute[{FrontEnd`NotebookLocate[{URL[theURL], None}]}]
>
> > or
>
> > NotebookLocate[{URL[theURL], None}]
>
> > I hope that this helps...
> > --David
> > A WorkLife FrameWork
> > E x t e n d i n g MATHEMATICA's Reach...
> >http://scientificarts.com/worklife/
>
> > On Feb 11, 6:03=A0am, Mark Fisher <particlefil... at gmail.com> wrote:
> >> Hi all,
>
> >> I know how to create a hyperlink and click on it to go to an URL in my
> >> browser. But I don't know how to write a program that does that
> >> without making the user click. In other words, I'd like a function
> >> such as
>
> >> openURL[url]
>
> >> that goes to the URL in the browser. Any ideas?
>
> >> --Mark
>
> --
> Murray Eisenberg =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 mur... at math.umass=
.edu
> Mathematics & Statistics Dept.
> Lederle Graduate Research Tower =A0 =A0 =A0phone 413 549-1020 (H)
> University of Massachusetts =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0413 545-2859 (W=
)
> 710 North Pleasant Street =A0 =A0 =A0 =A0 =A0 =A0fax =A0 413 545-1801
> Amherst, MA 01003-9305



  • Prev by Date: Re: "Assuming"
  • Next by Date: Re: open URL programmatically?
  • Previous by thread: Re: open URL programmatically?
  • Next by thread: Re: open URL programmatically?