MathGroup Archive 2004

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

Search the Archive

Re: Re: hyperlink to pdf files

  • To: mathgroup at smc.vnet.net
  • Subject: [mg45664] Re: [mg45565] Re: hyperlink to pdf files
  • From: Christopher Purcell <christopherpurcell at mac.com>
  • Date: Sat, 17 Jan 2004 02:34:33 -0500 (EST)
  • References: <bu0dkd$amu$1@smc.vnet.net> <200401140626.BAA19705@smc.vnet.net> <738C1FC2-481D-11D8-ACEF-000A9582419E@mac.com> <40081DA0.3040205@uos.de>
  • Sender: owner-wri-mathgroup at wolfram.com

Thank you Roland, with your clues I found my finger trouble, and some  
differences from your example.

Here is my working hyperlink under Mac OS X that solves my requirement  
perfectly - launching Adobe Acrobat or Apple Preview on a pdf file  
directly from the help browser.

Cell[TextData[ButtonBox["Examples Manual",
   ButtonEvaluator->Automatic,
   ButtonData:>{
     URL[
       StringJoin[ "file://",
         ToFileName[ {$AddOnsDirectory, "Applications", "MyPackage",  
"Documentation", "English",
           "References"}, "examples.pdf"]]], None},
   Active->True,
   ButtonStyle->"Hyperlink"]], "Input"]

Under OS X only 2 slashes are used after "file://" and in the  
ToFileName, the curly brackets must include only the directory list and  
not the file name. Under OS X there is no environment variable  
"userprofile" but I don't need it anyway.
  With OS X working I will now turn to Windows and see if the same rules  
apply - and if platform independence is really possible without yucky  
If [$OperatingSystem==, ] structures all over the place.


Christopher Purcell
Sensors & Actuators Group
DRDC-Atlantic, 9 Grove St., PO Box 1012,
Dartmouth NS B2Y 3Z7 Canada
Tel 902-426-3100 x389
Fax 902-426-9654
On Jan 16, 2004, at 1:21 PM, Roland Franzius wrote:

> On the question how to create platform independent and environment  
> dependent hyperlinks.
>
> Since I have no Linux System runnig Mathematica these hours perhaps this will  
> take you a step further:
>
> Cell[TextData[ButtonBox["Relativistische Quantenmechanik",
>  ButtonEvaluator->Automatic,
>  ButtonData:>{
>    URL[
>       
> StringJoin["file:// 
> /",ToFileName[{Environment["userprofile"],"Desktop","RelQm01.pdf"}]]],  
> None},
>  Active->True,
>  ButtonStyle->"Hyperlink"]], "Input"]
>
> ToFileName[]  without a wrapping List is considered  to be an error by  
> the Show  Expression translator button. I have added
> ToFileName[{ path,...,file }] and a third / in "file:///"
>
>
> -- 
>
> Roland Franzius


  • Prev by Date: RE: Pipes Inside Mathematica?
  • Next by Date: Re: Script, Gothic and DoubleStruck Characters
  • Previous by thread: Re: Re: hyperlink to pdf files
  • Next by thread: List arguments to functions