Re: problem with a hyperlink (button)
- To: mathgroup at smc.vnet.net
- Subject: [mg37906] Re: problem with a hyperlink (button)
- From: "Allan Hayes" <hay at haystack.demon.co.uk>
- Date: Tue, 19 Nov 2002 03:51:18 -0500 (EST)
- References: <ar7vkf$s6e$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Gerald, Interactive hyperlink creation via the menu: Find> Add/Remove Cell Tags ... and Input>Create Hyperlink... uses relative addresses provided both source and target notebooks have been saved at some time. I have a text cell, the source cell, containing "To target cell" in Folder1/Folder1.1/Folder1.1.1/ index.nb and a text cell, the target cell, in Folder1/Folder1.2/Folder1.2.1/Notebook Both these notebooks have been saved. Using Find> Add/Remove Cell Tags ... I give the target cell the tag "target" Using Input>Create Hyperlink... I make the text "To target cell" in the source cell into a hyperlink to the target cell. ButtonBox["To target cell", ButtonData:>{ FrontEnd`FileName[ { ParentDirectory[ ParentDirectory[ ParentDirectory[ ]]], "Folder1", "Folder1.2", "Folder1.2.1"}, "Notebook .nb", CharacterEncoding -> "WindowsANSI"], None}, ButtonStyle->"Hyperlink"] This can be used as a template -- Allan --------------------- Allan Hayes Mathematica Training and Consulting Leicester UK www.haystack.demon.co.uk hay at haystack.demon.co.uk Voice: +44 (0)116 271 4198 Fax: +44 (0)870 164 0565 "Gerald Roth" <gerald.roth at aon.at> wrote in message news:ar7vkf$s6e$1 at smc.vnet.net... > hi > > i have the following problem: > i am creating a index notebook for some notebooks that are located in a > subdirectory (e.g. /dir1/index.nb points to nb files /dir1/dir2/1.nb > /dir1/dir2/2.nb) this should be done independent of the topdir everything is > located in and independent of the operating system used. i use a script to > generate the "dir" and "name.nb" strings and they are pasted correctly into > the ButtonFunction. > > a friend of mine suggested to use > > ButtonBox["aszdfg", > ButtonData:>{ > FrontEnd`FileName[ {"dir"}, > "name.nb", CharacterEncoding -> "ISO8859-1"] } ,.... > > however, this does not work. i tried some things and ended with > > ButtonBox["open", > ButtonFunction:>{ > FrontEnd`NotebookOpen[ > > FrontEnd`FileName[ {"dir"}, "name.nb", > CharacterEncoding -> "ISO8859-1"]]}, > ButtonStyle->"Hyperlink"] > > however, this does not work, either. > > is there a clean way to set hyperlinks with relative paths ?? > > thanks for your help > > gerald roth > -- > ************************************* > Gerald Roth > M@th Desktop Development > > Tel: +43 - 316 - 57 16 33 > Email: Gerald.Roth at aon.at > ************************************* > >