- Using and Creating Text Macros
- Inserting a Text Macro into Your Source Code
- Defining Text Macros
- Creating New Macros
- Calling a Macro from Within a Macro
- Modifications
Inserting a Text Macro into Your Source Code
GoLive ships with some pre-defined text macros for you to use when working with your HTML source code. Though you can also use macros in Layout mode, which I'll cover later in the project, GoLive's default macros allow you to insert HTML code in source mode. For example, there's a macro to insert an opening and closing anchor tag, as well as one to insert an image tag with blank attributes. Other macros can be created for use within the JavaScript or Web Objects editors, or within any GoLive window. To apply a macro you simply need to type the macro's name and then press the macro command keys. To see how this works you'll now apply a pre-defined GoLive macro to insert an <a href=""> macro named "a".
-
Open a new or existing GoLive document and switch to the HTML Source editor.
-
Type a anywhere in the document window.
-
Press the macro command keys: Ctrl+Shift+M (Windows) or Command+Shift+M (Mac OS).
-
Advance your cursor to the next empty line down in the source code and type img.
-
Press the macro command keys again.
-
GoLive automatically inserts an <img> tag after the cursor with blank source and border attributes.
GoLive automatically inserts generic code for an <a> anchor tag after the cursor because a predefined macro named "a" contains this code.
Figure 1.1 The "a" macro inserts an <a> tag and a blank HREF attribute.
NOTE
Macro names are not case-sensitive; GoLive doesn't care whether you type the name in upper- or lowercase.
Figure 1.2 The "img" macro inserts an <IMG> tag and blank image attributes.