Kino Thanks for the explanation and the macros Ed On Jan 13, 2011, at 6:00 AM, Kino wrote: > On 2011-01-13 +0900 (JST), at 6:04 AM, Ed Wall wrote: > >> I would like, somewhat as in Microsoft Word, to link a pdf to a particular word in a text. Thus, when asked for the link address in Nisus I put in the usual file:// business. However, when I click on the link it opens the directory in which the file is located, highlights the file, but doesn't launch it. > > OS X used to work like MS Word but Apple changed the behaviour in Leopard or in Snow Leopard (I don't remember well) presumably for a security reason. Similarlily 'open -a Terminal script.sh' does not run the script anymore. > >> This is better than nothing I suppose, but is this all there is for files or do I need to do something additional? > > It is a bit tedious, but you can let the default application for the file type open a linked file by running the macro below with the insertion point somewhere in a link. > <http://www2.odn.ne.jp/alt-quinon/files/NWPro/link/OpenLinkedFile_20110113_nwm.zip> > > ### OpenLinkedFile ### > > # This macro misbehaves for urls containing escaped chars (e.g. %20 instead of a space). > > $sel = TextSelection.active > $attr = $sel.text.displayAttributesAtIndex $sel.location > if Defined $attr.link > Open URL $attr.link > # open file with a default app for the file type > # this comand works in a way similar to /usr/bin/open > else > exit 'No url link in the selection, exiting...' > end > > ### end of macro ### > > > I uploaded two other macros related to hyperlink. > <http://www2.odn.ne.jp/alt-quinon/files/NWPro/link/ApplyHyperlinkStyle_20110113_nwm.zip> > which adds 'Hyperlink' character style defined in the macro file to the frontmost document and applies it on all links in it. > > <http://www2.odn.ne.jp/alt-quinon/files/NWPro/link/Link2LocalFile_20110113_nwm.zip> > which makes it easy to insert a link to a local file. > > > Kino > >