Makro snippet inserter

Introduction to Makro

Makro is a utility which allows you to define string sequences and then 'play' them back as if you had typed them in at the keyboard. This is useful in cases where a pre-defined series of keyboard actions needs to be carried out frequently.

Makro allows you to maintain many different sets of macros and it also allows you to specify *Commands and system variables, so you can use it for such things as an e-mail address book or an application launcher as well as a text inserter.

For each macro, there is a name and a string field which are defined and edited via a dialogue box - or the file can be assembled and edited in a text editor such as StrongED. The name makes it simple to tell what each macro does. Each macro's name is displayed in the Slab which inserts that macro.

Makro integrates well with StrongED: it is easy to write snippets for insertion and snippets are inserted with no more than a single mouse-click.

Makro was written by Dave Thomas. Dave lost interest in the program and he left the development version Makro 1.59 with me. His last release was on Tristone but that site has been closed. Makro works well but not all the expanded features have been fully implemented.

When loaded Makro will install its icon on the icon bar. Clicking Select on this icon will open Makro's main window which initially will be in the bottom-left hand corner of the screen.

Using Makro

When you click with Select on a slab, the string associated with it will be inserted into whatever document or application currently has input focus (signified by a cream-coloured surround). Or, if you click with Adjust then the macro name, rather than the String will be inserted.

Makro's main window

makro/png The consists of a display which will show the file name of the macro set which is loaded. In this example SEInstr.

Right of this display icon is a pop-up menu selector which will display a menu of all available macro set. Several example sets are supplied.

Next are left and right bumper icons. Clicking these will cycle through the available macro set.

Top right is an icon which will enable/disable Makro's Hot key.

The rest of the window contains 64 slabs which will display the Names of the macros in this macro set. Note that 64 slabs are provided for possible expansion but only 32 can be used.

Makro's window Menu

makro1/png A menu click on any slab in Makro's main window will open the menu as shown. This has entries:

Edit macro
Moving the mouse pointer right off this entry opens the Edit macro dialog box for that slab. This allows you to define or change the Name and String which will be output when the slab is clicked. The dialogue box consists of two writable fields and two action buttons. These are:
  1. Name: writable
    Enter in here the name of the macro.
  2. String writable
    Enter in here what you want inserted when the slab is clicked on,
  3. Store button
    When you've entered what you want into the two writable fields, click on the Store button (or press Enter) and your Macro will be stored in the slab you clicked over. Note that the macro is not at this stage saved to disk.
  4. Cancel button
    This, when Select clicked, will shut the window without making any changes. Alternatively when Adjust clicked it will restore the original text.

You may find it easier to write the macro set direct to its file. See Macro Set Files

Dropping a text file on one of the slabs will load in the first line (i.e. before the first CR) or the first 255 characters of the file, into the slab.

Save set
This dialogue box allows you to save your currently defined macros to a named macro set which will, from then on, be available from the Load menu. This dialogue box is also used to delete macro sets - load the unwanted set into Makro and then save it with nothing in the save set box's Name field - the set will be deleted.
Clear set
This entry simply does that - wipes all the macros and renames the current set to Empty.
Sort set
This entry sorts the macros alphabetically by name.

Makro's iconbar Menu

Info
Standard About this program information
Save
Saves the current macro set. It also saves choices, such as the current window position and the state of the hot key switch icon.
Quit
As it says!

Hot Key

The hot key facility is active when its icon is ticked. This is the icon at top right of the main window. A click here will turn the hot key on/off. The state of this option is saved when you Save from the iconbar menu.

The Hot Key is Ctrl (either left or right). When the mouse pointer is over one of the slabs pressing a Ctrl key will trigger the macro concerned. This is useful for transient menus and dialogue boxes which would otherwise be closed by a mouse click. However this facility can get pretty annoying if you forget you have the pointer over the Makro window. So it is probably best to leave this off until needed.

String Format

All strings are passed through the RISC OS string translator (OS_GSTrans) prior to being inserted. This enables you to easily insert control characters and system variables. So system variables such as < Sys$Time>|M will be expanded into the form '19:51:42' and then a newline.

You can also enter ASCII codes directly by enclosing the code in angle brackets. Base 10 is assumed, but other bases can be used by prefixing the number with the base number and then an underscore. For example, <33> generates ! and <16_7E> generates ~.

However, to facilitate this certain characters must be reserved, or take on special actions. Basically this means that strings enclosed in angle brackets are turned into system variables (or characters) and characters prefixed by | are turned into control characters.

To insert the actual characters (< and |) you must either enter their ASCII codes in angle brackets or prefix them with the control character '|'.

RequiredStringalternative
|||<124>
<|<<60>

Control characters you may find useful are:

RequiredAlternativeAction
|M<13>Return
|C<3>Copy in most editors
|X<24>Delete/Cut in most editors
|U<21>Clear text in a dialog box
|V<22>Move in most editors

Makro's size limits

Parameter Maximum Notes
Name 20 characters
String 255
Inserted string 511 Expansion of system variables
Slabs 64 Only 32 can be used
Menus 64 First 64 Makro files

Macro Set files

Makro stores its choices in its application, so that is where you will find its macro set files. You can issue a *command:
*Filer_OpenDir <Makro$Dir>.Sets to open the directory.

If you wish to have these sets elsewhere you can alter Makro's !Run file to point to the required location. The line concerned is SetMacro Makro$Path .Sets.

Each file is a text file so easily written/edited in StrongED. Turning on Line numbers will simplify this - StrongED Window Menu -> Display -> Line numbers -> Physical. By default, line numbering starts at zero so even lines are Names and odd lines are Strings

Makro's own Slab editing icon is short, so long macros are often easiest worked out direct in the macro set file concerned.

Was this page helpful? Please email me and/or rate this page:


If you want a reply make sure any email address @torrens.org will not get spam-binned!
Optional comment

Other relevant pages

Top of page


Page Information

http://css.torrens.org/valid-html401-bluehttp://css.torrens.org/valid-css Document URI: http://stronged.torrens.org/man/features/makro.html
Page first published 31st of March, 2020
Last modified:Tue, 07 Apr 2020 14:05:09 BST
© 2020 - 2024 Dave Thomas, edited and re-written by Richard Torrens.