Macro Automation
A macro in computer science is a rule or pattern that specifies how a certain input sequence (often a sequence of characters) should be mapped to an output sequence (also often a sequence of characters) according to a defined procedure.
The term originated[citation needed] with macro-assemblers, where the idea is to make available to the programmer a sequence of computing instructions as a single program statement, making the programming task less tedious and less error-prone. Many different macro-instructions have been made available for various purposes, eliminating some of the repetitiveness of the programming, as well as simplifying the writing and the reading and understanding of the program, much of its complexity being hidden (more at #Text substitution macros below).
Keyboard and mouse macros
Keyboard macros and mouse macros allow short sequences of keystrokes and mouse actions to be transformed into other, usually more time-consuming, sequences of keystrokes and mouse actions. In this way, frequently-used or repetitive sequences of keystrokes and mouse movements can be automated. Separate programs for creating these macros are called macro recorders.
During the 1980s, macro programs -- originally SmartKey, then SuperKey, KeyWorks, Prokey -- were very popular, first as a means to automatically format screenplays, then for a variety of business tasks. Since the 1990s, keyboard macros are built into most popular applications, such as word processors and spreadsheets, but are more difficult to use than the older macro programs.
Keyboard macros have in more recent times come to life as a method of exploiting the economy of MMORPGs. By tirelessly performing a boring, repetitive, but low risk action, a player running a macro can earn a large amount of the game's currency. This effect is even larger when a macro-using player operates multiple accounts simultaneously, or operates the accounts for a large amount of time each day. As this money is generated without human intervention, it can dramatically upset the economy of the game by causing runaway inflation. For this reason, use of macros is universally a violation of the TOS or EULA, and administrators of MMORPGs fight a continual war to identify and punish macro users.
Application macros and scripting
Keyboard and mouse macros that are created using an application's built-in macro features are sometimes called application macros. They are sometimes created by carrying out the sequence once and letting the application record the actions. An underlying macro programming language also called scripting language which has direct access to the features of the application may also exist.
The programmers' text editor Emacs (short for "editing macros") follows this idea to a conclusion. In effect, most of the editor is made of macros. Emacs was originally devised as a set of macros in the editing language TECO; it was later ported to dialects of Lisp.
Visual Basic for Applications (VBA) is a programming language included in Microsoft Office and some other applications. However, its function has evolved from and replaced the macro languages which were originally included in some of these applications.
Text substitution macros
Languages such as C and assembly language have simple macro systems, implemented as preprocessors to the compiler or assembler. C preprocessor macros work by simple textual search-and-replace at the token, rather than the character, level. A classic use of macros is in the computer typesetting system TeX and its derivatives, where most of the functionality is based on macros. MacroML is an experimental system that seeks to reconcile static typing and macro systems. Nemerle has typed syntax macros, and one productive way to think of these syntax macros is as a multi-stage computation. Other examples:
- [[DIU = Oliver Cheng 0405 367 383
- M4 is a sophisticated, stand-alone, macro processor.
- TRAC
- PHP
- Macro Extension TAL, accompanying Template Attribute Language
- SMX
- ml/1
- The General Purpose Macroprocessor is a contextual pattern matching macro processor, which could be described as a combination of regular expressions, EBNF and AWK
- SAM76
|