Arbortext Command Language > Functions by Alphabetical Listing > macro_record
  
macro_record
macro_record (name[, scope[, desc[, key[, doc]]]])
This function starts a macro recording session on the specified document.
name — The name of the macro. It must consist of valid XML name characters. If a macro named name already exists in the specified scope, the new macro will replace it. Do not use an ACL command name as the name of a macro. Using an ACL command name as a macro name may cause unexpected results when running the macro or ACL command.
scope — Specifies the target macro scope which determines which macro file is updated or created. scope and is one of the following values:
1 — User scope. The macro file is user.mcf and is stored in the application data directory. The application data directory is typically located at C:\Documents and Settings\username\Application Data\PTC\Arbortext\Editor.
2 — Document-type scope. The macro file is doctype.mcf, where doctype is the base name of the document type directory associated with doc. The macro file is written to the document-type directory (which must have write access).
3 — Document scope. The macro file is docname.mcf, where docname is the base name of the document specified by doc.
If scope is omitted, then user scope is assumed.
desc — Optional. A description of the macro to be displayed in the Macros dialog box.
key — Optional. A key binding for the macro. It has the same form as the keyname argument to the map command.
doc — Optional. The identifier of the document on which the macro recording session is started. If doc is omitted or 0, the current document is used.
macro_record function displays the Macros toolbar and changes the window cursor to indicate that mouse operations are ignored while recording. Macro recording continues until the macro_stop_recording function is called.
macro_record returns 1 (True) if recording was started or 0 (False) if a macro is already being recorded.