Adobe GOLIVE CS2 User Manual page 610

Hide thumbs Also See for GOLIVE CS2:
Table of Contents

Advertisement

The Default.macro file can hold any combination of text, HTML or CSS elements and JavaScript strings. Where you
can use a given macro definition depends on its type attribute. If the type is set to "all, " the macro will be available in
all editors, including a simple text document window. If the macro has one of the other type attributes, it is only
available in the corresponding editor.
The Default.macro file is loaded when GoLive starts up to make it available throughout the application.
See also
"To insert text macros into the source code" on page 601
To insert text macros into the source code
Text macros are case-sensitive, which means that you must type them exactly as the name was defined in the macro
file.
To insert automated source code, type the macro name and press Shift+Ctrl+M (Windows) or
Shift+Command+M (Mac OS). This inserts the text macro identified by the word behind or below the text cursor,
provided it exists in the default source macro file.
Defining text macros
You define text macros by opening the Default.macro file with GoLive or a text editor and then typing, copying and
pasting, or dragging the appropriate code. You can also create your own macro files. Macro files are read in order and
the first definition encountered is used where more than one macro definition shares the same name and syntax
context. Text macro definitions must have the following basic format:
<macr o na m e="X Y" typ e="S yn t ax-C o n t e xt"><![CDATA[macr o-co nt e n t\]\]></macr o >
The first element in a macro definition is the macro name and type, which defines the syntax context. The value of
type may be "all", "html", "css", "javascript", "php" or the exact value of the name attribute of a syntax element defined
in the Default.syntax settings file or any other installed *.syntax files. With the exception of spaces and tabs, you can
use any combination of characters for a macro name, but you should restrict yourself to using letters and digits to
avoid using characters which have special meaning in a given syntax context.
The second element specifies the content of the macro—that is, the CDATA tag specifies the replacement text. The
selection in the replaced text is defined by the percent character (%). If you require a different selection character,
you can add the attribute, "selchar=(character)".
For example, an image element macro with basic attributes could look like this:
<macr o na m e="ima g e" typ e="h tml"><![CDATA[<im g "sr c=../GIFS/%???%.GIF" wid t h="20"
h e ig ht="20">\]\]></macr o >
You can also use a text macro to insert a string of formatted text. Here is an example:
<macr o na m e="w eb design" typ e="h tm l"><![CDATA[This We b S i t e was designed usin g
<b>G oL i v e .</b>\]\]></macr o >
Automating insertion point placement and text selection in text macros
You can place the insertion point or select text for overtyping anywhere in the insert.
Placing the insertion point in an insert is accomplished by adding an empty selection at the point you wish the cursor
to appear. Here is an example:
<macr o na m e="ima g e" typ e="html"><![CDATA[<im g "sr c=%%" wid t h="20" heig h t="20">\]\]></macr o >
ADOBE GOLIVE CS2
601
User Guide

Advertisement

Table of Contents
loading

Table of Contents