Hi Nick,
[can] bookmarks in one Nisus document […] be referenced by cross-references in another?
Not by cross-references, as far as I know, but it's possible to *link* multiple text locations in a Nisus document to a bookmark in another document with a macro. I know, this is not the same, but it's an easy and decent way to link documents.
You mention "links between documents" and then "cross-referencing." These are two different things. What I mean is, do you just want to jump from a document B to a bookmark in document A ? If yes, then there is a great macro available for that; it will show you all bookmarks in all open documents in a nice, clickable list window, so you can jump from one bookmark/document to another, each time just by one mouse-click.
Code: Select all
#This macro shows all bookmarks from all open documents:
$docMap = Hash.new
ForEach $doc in Document.openDocuments
$docMap{$doc} = $doc.allBookmarks
End
Show Find Results $docMap, "All Bookmarks"
Source: Macro Language Reference, p. 20
Or do you need the additional text that often goes with cross-references, such as: See
bookmarked text on page
5? If yes, then let's assume you have a bookmark in document A and you want to "cross-reference" that bookmark in document B. To do that, the bookmark's name must appear in document B. A macro can then (1) pick up (= copy) the name, (2) switch to document A and (3) select the bookmarked text. I find, this comes pretty close to a real cross-reference.
Example:
Suppose you have a bookmark in document A called "unhinged president." Then the "cross-reference" in document B could look like this:
Text, text, text, text, text, text, text, text, text, text, text, text,
text, text, text, text, text, text, text, text, text, text, text.
See The |unhinged president| in File [
fileName]
I marked the bookmark's name with two || just to make it stand out and remind me that the name is "unhinged president" and not "The unhinged president." You are free to change the marker, of course, and modify the macro accordingly.
Code: Select all
# Place the insertion point somewhere between the | | , that is, somewhere in the bookmark's name
Find "|", 'er'
Select End
Find @Text<(?:.|\n|\f)+?(?=\|)>, 'E'
Copy
$bm = Read Clipboard
Window:Next Window
Select Bookmark $bm
Instead of
Window:Next Window
one should use the appropriate
filename (and
filepath?)