Part of Nobumi Iyanaga's website. n-iyanag@ppp.bekkoame.or.jp. 12/29/98.

logo picture

Anchor Macro ReadMe

HTML Anchor macro set

This macro set helps the user to set easily "inner document links" of html files.

The package (14K to download) contains the macro file named "html anchor macro", a stationery file named "anchor list stationery", and this ReadMe.

The macro file contains these five macros:

The first macro "<br> & <p> in selection" is a simple goody added to the set. It adds <br> and <p> tags in the selected text. Select some text having cr and cr + cr, and run this macro. You will see easily how it works.

=============

Now, for the "e;anchor macro"e; set itself:

To use it, first, place the stationery file where you want -- but you must write its path name to the macro "anchor name list", in the line:

Open "Macintosh HD:Nisus Writer 5.1 Folder:5.1 Macros:anchor list stationery"

You must write also the path name of the "anchor list" file (which will be created by the macro "anchor name list"), in the line:

Save As "Macintosh HD:Nisus Writer 5.1 Folder:5.1 Macros:anchor list"

=============

Now, before using the macro set, you first must run ONCE the macro "anchor init". It initializes the global variable named "anchorName"

=============

Suppose there is a text like this:
=============

o Chapter 1
o Chapter 2
o Chapter 3

aiueo
kakikukeko
sashisuseso
tachitsuteto

Chapter 1
aiueo
kakikukeko
sashisuseso
tachitsuteto

Chapter 2
aiueo
kakikukeko
sashisuseso
tachitsuteto

Chapter 3
aiueo
kakikukeko
sashisuseso
tachitsuteto

=============

You first select the heading "o Chapter 1", and run the macro "Anchor Mark" :
Nothing happens apprearently, but the anchor name is registered.
To see what has happened, select the next two lines macro, and choose "Execute Selection"

Clipboard = anchorName
Show Clipboard

You can do the same for "o Chapter 2", "o Chapter 3", etc.

When you have finished, run ONCE the macro "anchor name list". The stationery file "anchor list stationery" opens, and the macro writes down all the names of the anchors. The stationery file will be saved with the name "anchor list". In this example, the list would be:

o Chapter 1
o Chapter 2
o Chapter 3

To set a link between the heading "o Chapter 1" and "Chapter 1" in the text, first select "o Chapter 1" in the stationery file; then, select the second "Chapter 1" in the text, and run the macro "anchor Set":
A dialog will appear, asking you to enter the name of the anchor. You can enter there for example "ChapA". The macro will insert the needed tags at the correct places...

So that your text will have these tags:

=============

<a href="#chapA">o Chapter 1</a>
<a href="#chapB">o Chapter 2</a>
<a href="#chapC">o Chapter 3</a>

aiueo
kakikukeko
sashisuseso
tachitsuteto

<a name="chapA">Chapter 1</a>
aiueo
kakikukeko
sashisuseso
tachitsuteto

<a name="chapB">Chapter 2</a>
aiueo
kakikukeko
sashisuseso
tachitsuteto

<a name="chapC">Chapter 3</a>
aiueo
kakikukeko
sashisuseso
tachitsuteto

=============

When you have finished, the file "anchor list" should be deleted.

To clear all the anchor names, choose again "anchor init".

I hope these macros will be helpful for you.

Please write me if you have any problems using these macros. I would welcome also any suggestions or comments.

Thank you in advance!

Nobumi Iyanaga
28/12/98


Go to Nisus Macros and Nisus/Frontier combo page
Go to NI Home Page


Mail to Nobumi Iyanaga


frontierlogo picture

This page was last built with Frontier on a Macintosh on Tue, Dec 29, 1998 at 1:30:33. Thanks for checking it out! Nobumi Iyanaga