hyperlink to pdf files
- To: mathgroup at smc.vnet.net
 - Subject: [mg45552] hyperlink to pdf files
 - From: Christopher Purcell <chris.purcell at drdc-rddc.gc.ca>
 - Date: Tue, 13 Jan 2004 04:04:05 -0500 (EST)
 - Sender: owner-wri-mathgroup at wolfram.com
 
I would like to insert hyperlinks to pdf files in notebooks in a  
platform independent way.
I can create a cell that looks like this:
Cell[TextData[ButtonBox["Examples Manual",
   ButtonData:>{
     URL[  
"file:///Library/Mathematica/Applications/MyPackage/Documentation/ 
English/References/examples.pdf"], None},
   ButtonStyle->"Hyperlink"]], "Input"]
that works great on MacOSX to hyperlink to the file examples.pdf.  I am  
sure I can do something similar on Windows, provided I use Windows  
style paths.
But to have this work in a platform-independent way,
I would like to make the argument of URL[ ]  to be something like:
"file:/ 
/"<>ToFileName[{$AddOnsDirectory,"MyPackage","Documentation","English"," 
References"},"examples.pdf"]
But this doesn't work. Putting Evaluate around it does not help. URL or  
ButtonData reject everything except the explicit text string. Any other  
ideas?
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