home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Fred Fish Collection 1.5
/
ffcollection-1-5-1992-11.iso
/
ff_disks
/
600-699
/
ff624.lha
/
MachIV
/
MachIV.doc
< prev
next >
Wrap
Text File
|
1992-03-21
|
112KB
|
2,949 lines
User's Manual
for
MachIV Version 4.0
and
SetMachIV Version 4.0
Copyright 1987-1992 by Brian Moats
MachIV and SetMachIV and this documentation are Copyright 1987-1992
by Brian Moats. Lawful users of these programs are hereby licensed
only to read the programs, from their media into the memory of a
computer, solely for the purpose of executing the programs.
Duplicating or copying for purposes other than backup is forbidden.
This manual, or parts thereof, may not be reproduced in any form
without the written permission by Brian Moats and Polyglot Software.
Disclaimer
This product is sold "as is" without representation or warranty of
any kind, either expressed or implied. The user assumes all risks and
responsibilities related to its use.
Information And Technical Support
Polyglot Software
884 W. Melrose Ln
Boise, ID 83706
(208) 336-4583
Table of Contents
Introduction...............................................1
The Sample Hotkeys..................................1
Terms Used..........................................2
Chapter 1
Usage...................................................3
Starting MachIV.....................................3
Terminating MachIV..................................4
Running SetMachIV...................................4
Loading MachIV.prefs................................4
SetMachIV's Gadgets.................................5
SetMachIV's Display.................................5
Chapter 2
Mouse Features..........................................6
Mouse Accelerator...................................6
Mouse Off...........................................6
SunMouse............................................6
Key Activate........................................6
Window Cycling......................................7
Click To Front......................................7
Mouse To Menu.......................................7
Playback Delay......................................7
Middle Mouse Button.................................7
Chapter 3
Clock Features..........................................8
Clock Displays......................................8
Clock To Top Window.................................9
Clock To Top Screen.................................9
Online Meter........................................9
Alarm...............................................9
Low Memory Warning..................................9
Alternating Date and Memory Display.................10
Clock On and Off....................................10
Clock Position......................................10
Clock Float.........................................10
Horizontal and Vertical Clocks......................10
12 and 24 Hour Time.................................11
Clock Font..........................................11
Date Format.........................................11
Chapter 4
Macros..................................................12
Recording Macros....................................13
Executing Macros....................................14
Correcting Mistakes.................................14
Aborting Execution..................................14
Clearing a Macro....................................14
Accidents Happen!...................................14
Chapter 5
Using SetmachIV and Macros..............................15
Changing The Current Hotkey.........................15
Selecting By Name...................................16
Modifying Macros....................................16
Copying and Appending...............................16
To a Named Macro..................................17
To Another Configuration..........................17
Add Macro...........................................17
Del Macro...........................................17
Maximum Macro Size..................................17
Help................................................18
Flags...............................................18
Sorting.............................................19
Printing Your Macros................................19
Chapter 6
More About Macros.......................................20
ARexx Support.......................................20
Viewing a Macro.....................................20
Recording Mouse Button Clicks.......................20
Recording All Moves.................................21
Recording Menu and Gadget Selections................21
Final Notes on Recording............................21
Using Escaped Characters............................22
Functions in Macros.................................22
Windows Functions - WIN_............................23
Activating..........................................23
Depth Arranging.....................................23
Moving and Sizing...................................23
Organizing Windows..................................24
Zooming Windows.....................................24
Closing Windows.....................................25
Sending IDCMP Messages..............................25
Window Message Examples.............................26
Window Selecting....................................26
Screen Functions - SCR_.............................26
Pausing Within a Macro - PAU_.......................27
Graphics Functions - GFX_...........................28
Executing Functions - EXE_..........................28
Auto Execution Based On Time........................28
Executing Programs..................................30
Using Templates - MAC_FINISH........................30
Miscellaneous Functions - MSC_......................31
Changing Directories................................31
Changing Priorities Within a Macro..................31
Text Functions - TXT_...............................31
Sending Date and Time...............................31
Identifying Labels and Comments.....................31
The Set Functions - SET_............................32
Clipboard Functions - CLP_..........................33
Chapter 7
Configurations..........................................35
Changing Configurations.............................35
Default Configuration...............................36
Windows and Screens With No Title...................36
Attaching to the Program's Name.....................36
Adding and Deleting.................................36
Loading and Saving..................................37
The Settings File...................................37
Chapter 8
Miscellaneous Features..................................38
Priorities..........................................38
Screen Blanking.....................................38
Macro Screen Blanking...............................38
Suspend.............................................39
Remove..............................................39
Check Waltz.........................................39
No Caps Lock........................................39
Beeping.............................................39
Hold Qualifiers.....................................40
Debug...............................................40
Appendix A
Special Functions......................................41
Appendix B
Escaped Characters.....................................47
Appendix C
Common Questions.......................................48
Appendix D
Graphic Print Options..................................50
Appendix E
Some Useful Macros.....................................51
- 1 -
Introduction
=====================================================================
MachIV is a utility program that provides hotkeys and many other
optional features for both shell and Workbench users. All options and
hotkeys may be changed at any time with SetMachIV. You may have
different hotkeys and settings for each window or screen.
MachIV gives you the ability to do things like: press a key and have
all open window titles displayed in a scrollable list. You can then
select one and have it brought to the front, closed or anything else
that you can think of.
Programs can be launched from hotkeys or executed at a specific time
and date. Windows and screens can be manipulated from the keyboard.
Keystrokes and mouse movements may be recorded and played back at the
touch of a key.
Commonly used words and phrases may be typed for you by using a macro
finish function. (See Using Templates in Chapter 6.)
You can quickly view the contents of the clipboard. The contents may
be pasted (even to windows that do not support the clipboard) or
printed. When pasting, you may have an append and prepend string
applied to each line and you may set a character and line delay.
SetMachIV is a separate program that is used to change all options
and to edit macros.
Both MachIV and SetMachIV require Workbench 2.04 or higher.
IMPORTANT: All hotkeys referred to in this documentation are included
in the sample MachIV.prefs file. In order to do the examples, MachIV
needs to load this settings file. You may change the hotkeys later.
The Sample Hotkeys
------------------
Left-Amiga-J Window to front. ('J'ump forward)
Right-Amiga-K Window to back. ('K'ick back)
Left-Amiga-N Screen to front and activate window.
Right-Amiga-M Screen to back and activate window.
Left-Amiga-ESC Create a new shell.
Alt-ESC Start or stop macro recording.
Ctrl-Alt-ESC Start or stop named macro recording.
Ctrl-Left-Amiga-ESC Run SetMachIV.
Ctrl-Left-Amiga-B Blank the screen.
Ctrl-Left-Amiga-N Execute a named macro.
Alt-Help Display a macro.
Ctrl-Left-Amiga-V View the clipboard.
Note: MachIV.020 and SetMachIV.020 have been optimized for the 68020
and 68030 processor chips. If you use these, you could rename
MachIV.020 to MachIV and you should rename SetMachIV.020.
- 2 -
Terms Used Throughout This Documentation
========================================
Qualifiers
----------
"Qualifiers" mean the keys Ctrl, Shift, Alt, Left-Amiga (C=), and
Right-Amiga.
Hotkey
------
The term "hotkey" means any other key pressed in combination with
zero or more qualifiers.
Macro
-----
"Macro" means the quoted string of characters that are sent as
keystrokes, the special functions that are to perform some particular
action, or a combination of these. A macro may be attached to a
hotkey or to no key at all. A single key may have up to 32 macros
attached to it, each with a unique qualifier combination. For
example, F1 may have a macro and so may Ctrl-F1, Ctrl-Alt-F1,
Shift-F1 etc.
A macro that is not attached to a hotkey is usually executed by its
name or automatically executed at some specified time.
Macro Name
----------
Any macro may have a name. The name may be used to describe the
purpose of the macro or it may be a short term that you may enter
when executing a macro by its name.
Some names have special significance. A macro named "Blank" will be
executed when screen blanking would occur. "Unblank" will be executed
if a "Blank" macro was executed and the mouse is moved or a key is
pressed.
A macro name MachIVQuit will execute when MachIV is terminated.
If you have multiple configurations, a macro whose name matches the
configuration name will be executed when that configuration becomes
active.
These special feature are explained more fully in Chapter 6.
CLI and Shell
-------------
These are used interchangably. They mean the system window that you
use to issue commands like: dir, info, list, copy, date etc.
- 3 -
Chapter 1 Usage
=====================================================================
Starting MachIV
===============
You can start MachIV by double clicking on its icon, by putting it in
the WBStartup drawer, by entering in your startup-sequence "Run >nil:
MachIV" or typing from the shell the same command.
You may follow the command with the settings file to load.
For example:
Run >nil: MachIV ENVARC:MachIV/MachIV.prefs
or
Run >nil: MachIV sys:configs/SpecialMachIV.prefs
Entering it in your startup-sequence (or User-Startup) file is the
preferred method as then MachIV will inherit the current path and
stack size. This can important when executing programs from MachIV
such as NewShell.
For example, you may use something like:
Path sys:utilities sys:tools sys:prefs add
Stack 10000
Run >nil: MachIV
LoadWb
Endcli <nil: >nil:
When you run MachIV with no file name to load as a settings file, it
automatically attempts to load MachIV.prefs from the current
directory. Failing that, it tries ENVARC:MachIV/MachIV.prefs.
If it still cannot locate the file, it will use some default setting,
but there WILL BE NO MACROS! In this case, you should cancel the
"MachIV.prefs Not Found" and "Using Defaults" requesters. You should
then use SetMachIV to load MachIV.prefs using the "Project" menu
selection "Open...".
The settings file may also be entered in the Tool Types gadget in the
icon. Use:
SETTINGS=path/filename.prefs
After MachIV is running, the only obvious indication of MachIV's
presence is the (optional) title bar clock. The real power of MachIV
is lying in the background waiting to assist you. Exactly what it can
do will depend on your settings file.
- 4 -
Terminating MachIV
==================
There are several ways to remove MachIV.
1. Double click on its icon.
2. Type MachIV in a shell.
3. Issue a "Break" command.
4. Activate the clock and press Ctrl-C.
5. In the "Miscellaneous Features" window of SetMachIV, click on
"Remove MachIV".
6. Execute a MSC_QUIT macro.
Running SetMachIV
=================
There are (at least) five ways to run SetMachIV.
1. The easiest is to activate the clock and press the right mouse
button.
2. You may use the hotkey Ctrl-Left-Amiga-ESC, which has EXE_SETMACH
as its macro.
3. Simply type SetMachIV in your shell window.
4. Double click on SetMachIV's icon.
5. Execute an EXE_CMD"SetMachIV" macro.
Method 1 and 2 are preferred because MachIV will signal SetMachIV to
move to the front immediately if it is already running, while
EXE_CMD"SetMachIV" must load SetMachIV from the disk. These macros
and hotkeys are explained in a later chapter.
NOTE: MachIV searches for a program named SetMachIV in the path as it
was set when MachIV was first run. If you want to use
SetMachIV.020, you should rename it to SetMachIV. You could also
specify the name and path in a macro using the function
SET_SETMACHIV_PATH"path/name". That will be explained later.
Loading MachIV.prefs
====================
MachIV.prefs is a text file that contains all your settings and macros.
It is loaded when MachIV is first run. If MachIV is unable to find
the file, you can load it using SetMachIV. To do this, run MachIV and
then run SetMachIV using one of the methods described above. From
SetMachIV's Project menu select "Open..." and pick the MachIV.prefs
file from the file requester.
- 5 -
SetMachIV's Gadgets
===================
The string gadgets in the windows are initially inactive - you may
activate them either by clicking in them or by pressing the TAB key.
Successive pressing will activate the other string gadgets.
Some gadgets have a letter underlined. Pressing that letter will have
the same effect as clicking on the gadget. Note that this will not
happen if a string gadget is active.
Pressing the up and down arrow keys has the same effect as clicking
on the up and down gadgets located under the current hotkey text.
SetMachIV's Display
===================
SetMachIV may open its main window on the Workbench screen or on a
custom interlaced or non-interlaced screen. If desired, the custom
screen may scroll up from the bottom.
All of these settings may be set from the "Preferences" menu. The
change will take affect immediately. If you want it to always open
the way that you have selected, save from the "Project" menu's
"Save" or "Save As..." menu items.
- 6 -
Chapter 2 Mouse Features
=====================================================================
All mouse features are adjusted or toggled on or off in the "Mouse
Features" section of SetMachIV. Some features may also be modified
with macros.
To open the "Mouse Features" window, click on the "Mouse Features"
gadget or press "M".
Mouse Accelerator
=================
Move the mouse. Notice how much quicker it moves? Both speed and
sensitivity are adjustable. "Speed" is an acceleration factor applied
to mouse movements. The "Threshold" adjusts the sensitivity of the
mouse (how soon it kicks in). Low values decrease the sensitivity.
Set "Speed" to 0 to disable the accelerator. While you can set the
speed and acceleration in the Prefs/Input program, MachIV has a
little more flexibility plus you can use negative values for the
speed to slow it down. This is sometimes useful for fine control in
painting programs. The speed may also be set by using the macro
function MOU_SPEED"nn".
Mouse Off
=========
Press a key. Notice that the mouse disappeared? When you move the
mouse, it reappears. MachIV assumes that if you are typing you do not
want the mouse in the way. It will also turn the mouse off after 5
seconds of inactivity. This time delay is adjustable in SetMachIV
with "Mouse Off Delay" or with MOU_OFF"nn" in a macro, where nn
equals the number of delay seconds. Set "Mouse Off Delay" to 0 to
disable this feature.
SunMouse
========
Now move the mouse into another window. The window under the mouse
automatically becomes the active window. This is called "SunMouse",
named for the way in which mice behave on Sun workstations. To
prevent windows that the mouse is merely passing over from becoming
active, a window is not activated until the mouse comes to a stop.
This is different from the Commodities program "AutoPoint".
The "SunMouse" may be toggled on and off with MOU_SUN in a macro.
Key Activate
============
Instead of using the "SunMouse" feature, you may activate the window
that is under the mouse by pressing a key.
- 7 -
Window Cycling
==============
If you have more than one window open, place them so that one is
behind the other. Now with the mouse over the top window, press and
hold the left button and press and release the right button. The top
window will move to the back. This is called "Window Cycling". If the
mouse is over a "backdrop" window, the only window on the screen or
no window, the screen will be sent to the back.
Click To Front
==============
Now place a window behind another so that you can see just part of
it. Move the mouse into this area and click quickly three times. That
window should now be the top window. This is the "N Click" feature
where N is the number of clicks required and may be set from 0 to 4.
Mouse To Menu
=============
When this feature is on, every time you press the right mouse button
the pointer will jump to the menu bar. When you release the button
it will return to where it was. With this option selected, you will
also get "menu wrap-around". When the mouse moves to the right of the
menu, it will wrap around to the left side. Whn you move to the left
of the first menu, the mouse will move to the right item. "Mouse To
Menu" may be toggled on and off with MOU_TO_MENU in a macro.
Play Delay
==========
When recording and playing back mouse movements, you may set a delay
in this gadget. The values are in 50ths of a second. See Chapter 6,
for more information.
Middle Mouse Button
===================
Some third party mice have a middle button that may be put to good
use. While most prefer to have the middle button behave like the
shift key, it can function as any key that you want. To do this
requires the executing of a special function in a macro. This is
explained more fully in Chapter 6, but to simply convert the middle
button to the shift key execute this macro:
SET_KEY"\MM,\S"
This could also be an auto-executing macro which executes when MachIV
is first run:
EXE_AUTO"" SET_KEY"\MM,\S"
- 8 -
Chapter 3 Clock Features
=====================================================================
To open the "Clock Features" window, click on the "Clock Features"
gadget or press the letter "L".
There is a wide variety of clocks to choose from. Cycle through them
by clicking on the "Clock+Memory", "Memory Only", "Clock+Date",
"Clock Only" and "Coordinates" gadget. These are shown below. If you
select "Clock+Memory" or "Memory Only", and if you do not have any
"Fast" memory, the clock will just show "Mem". "Coordinates" shows only
the X and Y position of the mouse in the active window.
You may also change the clock type and orientation (vertical or
horizontal) by activating the clock with the mouse and pressing the
keys "1" to "5" and "H" or "V".
Clock Displays
==============
Clock+Memory
------------------------------
| Chip 456 Fast 357 4:32:45 |
------------------------------
Memory Only
---------------------
| Chip 456 Fast 357 |
---------------------
Clock+Date
-------------------
| 8-01-90 4:32:45 |
-------------------
Clock Only
-----------
| 4:32:45 |
-----------
Clock+Memory (No fast memory)
---------------------
| Mem 456 4:32:45 |
---------------------
Coordinates
----------
|XXX YYY|
----------
Besides showing time and memory, the clock also displays many helpful
messages such as "Select Hotkey...", "Recording Macro...", "Executing
Macro..." and "Macro Aborted!".
- 9 -
Clock To Top Window
===================
You may select to have the clock pop to the top or front window by
selecting "PopTop". Selected or not, an invisible depth gadget is
placed on the far right side of the clock (horizontal clocks only).
It functions the same way as a normal depth gadget, the imagery is
just written over by the time text.
Clock To Top Screen
===================
The clock may also pop to the top or front screen by having "Top
Screen" selected. This and the "Any Screen" option will place an
invisible screen depth gadget on the left side of the clock. You may
select "WB Screen" to keep it on the Workbench screen.
Note: These must be used with some caution as not all programs work
properly with another window on their screen. Some programs refuse to
close their screen while the clock is on it. Some programs terminate
but leave their screen behind. If you feel adventurous, you can close
a screen that has been left behind with SCR_KILL in a macro. Killing
a screen may cause a system crash if the program owning the screen
expects it to be there.
This option also replaces the CloseScreen vector. You may experience
some incompatibility if you, for example, run another program that
also replaces this vector, run MachIV and then terminate the first.
The general rule for running programs that do this is to terminate
them in the reverse order that they were run.
Online Meter
============
You may select to have the time portion of your clock keep track of
your online costs by selecting "Meter". Clear your costs with "Meter
Reset". Put the online rate (cents per hour) in the "Rate" gadget.
Alarm
=====
An alarm may be set in the "Alarm" gadget. Use 24 hour format without
the ":" like "1930" not "19:30". The clock will beep six times when
it goes off. (You can set more alarms in macros with the EXE_AUTO
function. See Chapter 6.)
Low Memory Warning
==================
If you would like to be alerted to low memory situations, enter the
memory warning level in the "Low Mem" gadget. When free chip
(graphics) memory drops below this value (in kilobytes), the clock's
text will turn white (or whichever color is set by color number 2).
- 10 -
Alternating Date And Memory Display
===================================
If you want the clock's display to alternate between memory and time,
and the date, enter the number of seconds to show the memory and time
in the "Date/Time (sec)" gadget.
Clock On And Off
================
You may, of course, turn the clock on or off by selecting the "Clock"
gadget.
Within a macro, a clock may be turned on with CLK_ON, turned off with
CLK_OFF, toggled on or off with CLK_ON_OFF and sent to the front
screen with CLK_FRONT.
Many messages are displayed in the clock. They range from error
messages to prompts.
In a macro you can display custom messages with
CLK_CUSTOM_MSG"message"
See More About Macros in Chapter 6.
These messages may also be spoken by selecting "Speak Messages" in
the "Miscellaneous Features" window. The device "Speak:" must be
mounted.
Clock Position
==============
You can change the clock's position by entering the left edge and top
edge in the "Left Edge" and "Top Edge" gadgets. An easier method is
to position the clock with the mouse and then enter a -1 in these
gadgets. The current values will then be entered for you. Turn off
"Float" when doing this.
Clock Float
===========
If you are using a virtual Workbench screen (one that is larger than
the display area), the screen can automatically be scrolled with the
mouse. This is a feature of Workbench. The clock would normally
remain in its original position but if you select "Float", the clock
will keep its position relative to the display's left and top edge.
Horizontal and Vertical Clocks
==============================
You can select "Vert" or "Horz" to change the clock's orientation. In
some applications users find it convenient to place the clock in the
vertical scroll bar.
A vertical clock with an invisible screen depth gadget may be dragged
by carefully positioning the pointer on the upper right corner of the
clock.
- 11 -
You can also change the orientation by activating the clock with the
mouse and pressing "H" or "V". Most keyboards have these keys in the
same location, but if yours doesn't, you need to press the keys that
are in the same location as on the USA keymap.
12 and 24 Hour Time
===================
Select 12 Hour or 24 Hour to show the desired format.
Clock Font
==========
You may select the font for the clock to use by entering it in the
"Clock Font" gadget. Enter the font name (without the .font
extension) and the point size. For example:
Opal 12
or
Diamond 15.
If you want to use the default font, enter nothing. The
diskfont.library must be available to use this feature. While only
non-proportional fonts are recommended, MachIV does attempt to
properly size the clock. With proportional fonts there will probably
be part of previous seconds visible on the right edge.
This feature is global. That is, it affects all configurations.
Date Format
===========
The date is available in four formats selectable in the "Clock
Features" window. As you cycle through these, the date will be
displayed above the gadget. You may also chose your desired separator
character in the adjacent string gadget labeled "Separator".
The date format selected will be used in the clock and TXT_DATE_PASTE
and TXT_DATE_PRINT macros functions.
These two features may also be changed with the functions
SET_DATE_FORMAT"DOS/INT/USA/CDN" SET_DATE_SEPARATOR"-".
- 12 -
Chapter 4 Macros
=====================================================================
The real power of MachIV is its macro ability. A macro may be simply
recorded keystrokes and mouse movements that can be played back. But
they can also perform many window and screen functions, bring up a
list of windows or screens that are open, display the clipboard and
execute other programs.
In their simplest form, macros are just strings of keystrokes in
double quotes that are attached to hotkeys. You may, for example,
have a macro that contains the text:
"diskcopy df0: to df1:"
When played back, these letters will appear in your active window
just as if you typed them.
Besides having letters in macros, you may include any special key by
preceding a letter with a backslash. This is called an escape
character. Some examples:
\F1 is Function key 1
\E is the ESC key
\5 is numeric key pad 5
These will be entered for you during recording. You can see all of
them by pressing "Help" in SetMachIV. They are also listed in
Appendix B.
All special functions have a three letter prefix followed by an
underscore followed by the actual function. For example:
SCR_WB_TO_FRONT Send the Workbench screen to the front.
WIN_FRONT_TO_BACK Send the front window to the back.
Some functions require arguments which follow the function and are
enclosed in double quotes. Examples:
EXE_CMD"NewShell" Create a new shell.
WIN_ACTIVATE"Workbench" Activate the Workbench window.
These are not case sensitive, CLP_VIEW, Clp_View and clp_view are all
acceptable. In order to tell whether or not a quoted string is an
argument or keystrokes, spaces are not allowed beytween the function
and its arguments. WIN_ACTIVATE"NewShell" is okay but
WIN_ACTIVATE "NewShell" is not.
Functions such as these cannot be recorded, they must be entered
using SetMachIV. See Chapter 5, "Using SetMachIV And Macros" to find
out about viewing and modifying macros. There are many more of these
functions listed in Appendix A.
- 13 -
Recording Macros
================
One of the more important functions is MAC_RECORD_KEYED. This is the
function that starts or stops a recording session. In the sample
MachIV.prefs file, this is attached to the key combination Alt-ESC.
By pressing this, and then pressing the key combination that you want
for the hotkey, you begin a recording session. Press any keys or
mouse buttons that you want recorded and then press Alt-ESC again.
The macro is now ready to be played back.
A practice session may help you to understand. To do this, you must
be in a Shell window. You also need a MAC_RECORD_KEYED macro already
setup and attached to Alt-ESC. You should have this already if MachIV
loaded the sample MachIV.prefs file.
Press Alt-ESC You will hear a beep and the clock will
display the message "Select Hotkey..."
Press Alt-D The clock will display "Recording Macro..."
Now type "dir df0:" without the quotes and press Return.
The directory of the disk in df0: will be displayed.
Now press Alt-ESC again to end recording.
You may now press Alt-D and your recorded keystrokes will be played
back.
You will also hear a short beep for each keystroke and mouse button
entered during recording.
This macro may be viewed with SetMachIV by clicking on "Select
Hotkey" and then pressing Alt-D. The macro should be in the top of
the Macro list box and in the string gadget underneath. You may edit
it if you like or delete all the characters to free the hotkey.
Notice that while you did not type the quotes, they appeared in the
macro in SetMachIV. All text that you want played back as keystrokes
must be enclosed in quotes.
You may also view the macro by pressing Alt-Help and then Alt-D when
the "Press A Hotkey To Display" window appears. Press Alt-Help again
to close the help window.
REMEMBER! All keystrokes in a macro must be enclosed in double
quotes. If you need to enter double quotes within the
macro, you must preceed them with a backslash. Example:
"This is a macro with a \" in it."
Also note: Some editors (TurboText is one) or word processors may not
seem to accept played back keystokes immediately. This can
usually be corrected by setting the "Playback Priority" to
0 or to whatever the priority is of the appliation.
- 14 -
Executing Macros
================
Macros may be executed by simply pressing the hotkey that it is
attached to. In addition, they may be executed by name or at a
specific time and date. See the section Auto Execution Based On Time
in Chapter 6 for time and date execution.
In the supplied MachIV.prefs file, there is a function named
MAC_SELECT_NAMED"" attached to Ctrl-Amiga-N. By pressing this, a
window with a scrollable alphabetized list of all macros that have
names will appear. You may select from this list and the macro will
execute.
The string gadget below this list will be initially empty and active.
After you have made a selection, the string gadget will be preset
with the previously used named and will be inactive. This allows the
use of "O" and "C" for the "Ok" and "Cancel" gadgets. You may
activate the string gadget by pressing the Tab key.
Correcting Mistakes
===================
If you are recording a macro and you press Backspace to correct a
typing error, the error and the backspace will be recorded. You may
use Ctrl-H to correct a keystroke without recording the mistake or
the backspace. Because of this feature, you cannot record Ctrl-H. If
you need to, you may enter it as \Ch in the macro from SetMachIV. (If
you are using a keymap that has "H" in a different location from the
usa keymap, you must use the key that has the key code of 25 hex.)
Aborting Execution
==================
Pressing ESC during macro execution will abort further execution. An
exception to this is when pausing for variable length input
(PAU_VAR_INPUT""). In this case, press ESC to terminate input and
Ctrl-ESC to abort the macro. See Chapter 6, Pausing Within A Macro.
Clearing A Macro
================
To clear a macro, that is, to free it from a hotkey, press Alt-ESC,
then the hotkey, then Alt-ESC again. This records no keystrokes which
means that the macro is empty and the hotkey is free. You may also
clear macros using SetMachIV as will be explained in Chapter 5.
Accidents Happen!
=================
If you should accidently press the Alt-ESC hotkey, the clock will
display "Select A Hotkey...". Simply press Alt-ESC again. No harm
done!
If you accidently press Alt-ESC and then more keys, the first key
pressed after Alt-ESC will become a hotkey with the following keys
the macro. You can press Alt-ESC again to stop recording. Then press
Alt-ESC, then the "accidental" hotkey, then Alt-ESC again.
- 15 -
Chapter 5 Using SetMachIV And Macros
=====================================================================
The main window of SetMachIV is where you do most of the work with
macros. Macros may be created, modified, copied or appended in this
window.
You may also create new or delete additional configurations with the
list gadget and the "Add" and "Del" gadgets located in the upper left
corner. Using multiple configurations is discussed in Chapter 7.
Changing The Current Hotkey
===========================
The current Hotkey is displayed in the text box just under the
"Select Hotkey" gadget. The qualifiers needed for this hotkey will be
highlighted below and to the left. The actual macro will be displayed
both in the "Macros" list box and in the string gadget underneath. If
more than one macro is attached to a particular key, they will also
be displayed in the list box. The macro's name, if any, will be
displayed in both the "Macro Names" list box and the string gadget
underneath.
It is important to note that the two list boxes are independant. A
macro name and its associated macro may not be the same horizontally
if you use the scroll gadgets on the side. They will, however, be
directly opposite each other after you select a macro or hotkey.
To modify or delete a macro, you first must make that macro the
current one. The simplest way is to click on "Select Hotkey" and then
when prompted by the
"Press A Hotkey Combination"
message, press the desired hotkey. (If you want to make a mouse button
current, hold down your selected qualifier keys and click INSIDE the
message box.)
You may abort this step by pressing ESC. Because of this, you cannot
select ESC this way. If you want to select ESC, click on "Select
Hotkey" and press Ctrl-ESC or Shift-ESC (for example) and then click
on the qualifier gadgets until none are highlighted.
Also, because you rarely want a macro attached to the left mouse
button and because it is easy to accidently click it, you must select
it in a similar manner as for ESC.
You may step through all the keys that have macros one by one with
the up and down gadgets. These are located next to the Shift
qualifier gadget. Only the keys that have macros attached will be
displayed. You may also use the up and down arrow keys.
- 16 -
If the macro is in the list box, you may click on it or on its name.
The macro will then be displayed in the string gadget and the
qualifiers for the hotkey will be highlighted.
You may also click on the qualifier gadgets to make a hotkey current.
If you select qualifiers that have no macro, the Macro string gadget
will be empty, ready to accept a new macro.
If you have a non-standard keyboard, additional keys will display
their keycode in the current hotkey gadget.
Selecting By Name
=================
The "Macro Names" list box displays a (possibly) descriptive name for
the macro.
If you want to display a macro by its name, click on "Select Named"
and select or enter the name in the list gadget that will pop up. The
string gadget may not be initially activated. You may activate it in
the normal way by clicking in it, or by pressing the Tab key.
You may also select a named macro by entering the name in the "Macro
Names" string gadget and pressing Shift-Return. Pressing just Return
will simply change the name of the current macro.
To display macros that are not attached to any key, click on "Select
Hotkey" and then press the Caps Lock key.
Modifying Macros
================
Once that you have made the desired macro current, you may modify or
delete it, or copy or append it to another hotkey.
Click in the "Macro" string gadget to make your changes. Press
Right-Amiga-X or click on "Del Macro" to delete it.
To enter the example from Chapter 4, click on "Select Hotkey" and
then press Alt-D. Now enter "dir df0:\N" (with the quotes!) in the
"Macro" string gadget and press Return. That's it! "dir df0:<Return>"
will be played back when you press Alt-D. If you recorded the
previous example, the macro will already be there.
Copying And Appending
=====================
"Copy" will copy a macro from one hotkey to another and "Append" will
append a macro to another hotkey. First make the hotkey that you want
to copy or append FROM the current hotkey. Then select "Copy" or
"Append". When prompted by the flashing message, press the desired
hotkey combination that you want to copy or append to.
- 17 -
To A Named Macro
================
To copy or append to an unkeyed named macro, proceed as above but
press Caps Lock when prompted for a hotkey and then enter or select
the name from the list gadget that will appear.
To Another Configuration
========================
Proceed as above but when the message is flashing, select the desired
configuration from the list box in the upper left corner of
SetMachIV, then select your hotkey.
****** CAUTION! ******
Once the "Press A Hotkey Combination" message is flashing, any key
that you press will receive the macro...except ESC. Use this key to
abort. You cannot copy to the ESC key.
Add Macro
=========
Selecting "Add Macro" will prompt you to select a new hotkey unless
the NO KEY macros are being displayed. Again, you may use Caps Lock
to select a macro by name.
Del Macro
=========
Clicking on "Del Macro" will delete the current macro. This is the
same as clicking in the current macro string gadget and pressing
Right-Amiga-X and Return.
Maximum Macro Size
==================
The default maximum macro size is 512 characters but this may be
changed in the "Buffer Size" gadget. This controls the size of
dynamic buffers which are allocated only during macro recording or
when SetMachIV is running. The actual macros take up only as much
space as they need plus a little bit of overhead. The maximum size
allowed is 32,767 characters. If you try to enter too small a size,
the minimum needed for your largest macro will be entered for you.
Note: If you are recording all mouse movements, you will need to set
the buffer size considerably higher than 512.
Curiosity note: Why 512? Why not 500? 512 is one half of 1024 which
is 1K. Programmers have a hard time shifting from bits, bytes and Ks
among other things.
- 18 -
Help
====
Clicking on "Help" (or pressing the "Help" key) will show all the
escaped characters and special functions that may be used in macros.
They are also listed in Appendices A and B.
Flags
=====
Macros may have four features attached to them that are selected from
the "Flags" window. Click on the "Flags" gadget to view or change
these flags.
Write Protect - When checked, you cannot record over the existing
macro. It may still be modified in SetMachIV. It
is a good idea to write protect macros like your
NewShell macro and the macro that starts and stops
recording. Hex representation - 0x80.
Disabled - When this flag is checked, the macro will not
execute and the key will be passed through to
other programs. Hex representation - 0x40.
Temporary - A hotkey may be marked as temporary by checking
this flag. When you save your settings file the
name and flags will be saved but not the macro. If
you commonly use particular keys for recording
"scratch" macros, it may be a good idea to mark
these as temporary. Hex representation - 0x20.
Relative - When this is checked, all mouse moves will be
relative to the active window. Mouse actions that
select icons should probably be recorded to a
macro that is marked as relative so that when
playing back the macro it will not matter where
you have placed the window containing the icons.
Hex representation - 0x10.
The "Clear All" and "Set All" gadgets in the "Flags" window will
clear or set the flags that are displayed for all macros in the
current configuration. You could check the "Write Protected" flag and
then click on "Set All". All macros would then be protected.
These may also be set with the macro function:
MSC_SET_FLAGS"xx,name"
This actually toggles the state of the flag. If it is on, this will
set it. If it is off, this will clear it.
Examples:
MSC_SET_FLAGS"40,StartStop" Set the "Disabled" flag.
MSC_SET_FLAGS"80,StartStop" Set the "Write Protect" flag.
- 19 -
Sorting
=======
If a key has just a few macros, it probably doesn't need to be
sorted. But if you have a large number of named macros, it is easier
to locate them if they are sorted.
First make the hotkey current (or NO KEY for unkeyed macros), select
"By Name" or "By Macro" and then click on "Do Sort".
Printing Your Macros
====================
If you find that it is getting difficult to remember all your macros,
SetMachIV provides the ability to print them in a table format.
Click on "Print Macros". A small window will appear with three
gadgets. You can select to have the output sent to a window for
viewing, sent to your printer, or sent to a file for later editing.
When the desired destination has been selected, click on "Go". If you
have selected to have the output sent to a window, after each window
full of macros have been displayed, press <Return> to continue. Press
Ctrl-C or click on the close gadget to quit.
If you have more than one configuration, just the current one will be
printed. To print other configurations, make it active and then
select "Print Macros".
- 20 -
Chapter 6 More About Macros
=====================================================================
ARexx Support
=============
Macros may be sent to MachIV from ARexx programs with the ARexx
command:
address 'MACHIV' 'macro string'
MachIV will execute the macro just as if you pressed the hotkey.
No results are returned.
address 'MACHIV' 'WIN_TO_FRONT"AppTitle" WIN_SIZE"AppTitle,500,50"'
Viewing A Macro
===============
You can view a macro by executing the MAC_SHOW function in a macro.
This is Alt-Help in the sample MachIV.prefs file. You will be
prompted for a hotkey combination. Use the same macro to close the
window. This is useful if you feel the need to double check just what
a particular hotkey does before executing it.
Recording Mouse Button Clicks
=============================
Mouse button clicks may be recorded, or entered manually in the
"Macro" string gadget. When recording a button click, MachIV puts in
the mouse's position, which button it was and whether it was pressed
or released. For example:
MOU_XY"155,075" MOU_LBD
When played back, the mouse will be moved to x = 155, y = 75 and a
left button down will be sent.
A PAU_SECONDS"nn" will be inserted for every nn seconds delay between
clicks. This will allow for menus to drop or requesters and windows
to open. You may adjust or delete them from your macro if desired.
You may manually enter tenths of a second such as PAU_SECONDS".4" or
PAU_SECONDS"1.6"
If you record just the left button, you might see something like this
for the macro:
MOU_XY"155,075" MOU_LBD PAU_SECONDS"1" MOU_LBU
unless you moved the mouse between pressing and releasing the mouse
button, in which case the new x and y values would be entered before
the MOU_LBU.
- 21 -
Recording All Moves
===================
If you need all mouse movements recorded, for a painting
demonstration for example, you need to set the "Play Delay" value
(found in Mouse Features) somewhere between 1-99. These represent
delays of 50ths of a second between moves. 1 = 1/50, 2 = 2/50 etc.
This is needed during playback by many programs in order to keep up
with the movements.
Note that this value must be set to some positive number both BEFORE
recording and during playback. During playback, you may get
acceptable (although fast) results by setting "Play Delay" and
"Playback Priority" to 0. During recording, the clock message should
be "Recording Macro...ALL".
Recording all moves requires much more memory than you would normally
need. Use it only if you need to. You may also need to set a larger
value in "Buffer Size".
Recording Menu And Gadget Selections
====================================
When a menu item has a subitem it may be neccessary to bring the
mouse down to the menu item, click the left button on it, then move
the mouse over the subitem and click the left button or release the
right button. Sometimes gadgets will not respond to a quick button
down/up. It may require a pause between the down and up.
Do not use a pause larger than one second after the right button is
pressed for a menu selection. The macro will stop executing.
For a better method, see the section on sending menu and gadget
messages directly to a program with the WIN_SEND_MENU,
WIN_SEND_GADGET_DOWN, WIN_SEND_GADGET_UP and WIN_SEND_CLOSE functions.
Final Notes On Recording
========================
The mouse will be moved to the same position as when recorded which
may or may not be over the desired gadget or icon. See the Flags
section in Chapter 5 for relative movements.
If you are pressing a qualifier such as Shift, it (\S) will be placed
before a MOU_XY"xxx,yyy" and will affect the mouse movement and the
first click. e.g.
"\S" MOU_XY"330,122" MOU_LBD
Do not depend on the SunMouse to activate a window during play back.
When recording, click in the window to activate it, even if it is
activated by the SunMouse.
- 22 -
Using Escaped Characters
========================
All non-printable keys are preceded by a backslash "\". For example,
\B is the Backspace key, \H is the help key and \F3 is function key 3.
These qualifiers modify the key or mouse activity immediately
following them:
\C Control.
\S Shift (either one).
\A Alternate (either one).
\L Left-Amiga (C=).
\R Right-Amiga.
"\Cc\u\A\S\l"
This plays back the key combinations:
Ctrl-c up-arrow and Alt-Shift-Left-Arrow
You do not need \S or \A before any character that is printable. For
example Alt-E displays the copyright symbol ©. You can press Alt-E
instead of entering \Ae.
Note that all escape characters must be used in the case as shown.
Also, the backslash itself and double quote marks must be preceeded
by a backslash. For example: "A backslash \\" "A double quote \""
Functions in Macros
===================
All special functions have the same basic format. They all begin
with a three letter mnemonic code followed by an underscore, followed
by the function. Any arguments to the function follow enclosed in
double quotes.
Many functions accept a single argument that is often optional. For
many WIN_ functions the argument specifies which window to apply the
function to. No argument indicates the top (front) window, a null
argument ("") indicates the active window while "title" will perform
the action on the window that has its title in the quotes.
When more than one argument is required and the first argument is a
window title, just inserting a comma will indicate the active window.
If you want the action applied to the top window, you will need to
first activate it with WIN_ACTIVATE with no argument.
As in quoted text, if you need a backslash \ or double quote ", you
must preceed it with a backslash. In argument strings, commas are
argument separators. You must also preceed them with a backslash it
they are not intended to separate arguments.
This is most frequently encountered in EXE_CMD functions. As an
example, you should use:
EXE_CMD"echo >speak: \"time for lunch\, now!\""
- 23 -
Identifying Labels And Comments
===============================
For the purpose of identifying portions of your macro or for adding
comments, any text may be inserted most anywhere. Do not use double
quotes or underscore characters. For example:
MOU_XY"167,134" MOU_LBD MOU_LBU Mouse click on OPEN Gadget
Window Functions - WIN_
=======================
There are many window manipulation functions, most of which require
one or more arguments.
When using "title", you may preceed the title with the $ symbol to
activate a window based on the name of the program that owns it.
Example: WIN_ACTIVATE"$program". Use the program AllTitles to
determine the correct name to use, if there is one. This feature has
limitations, see the section Changing Configurations in Chapter 7.
Activating
==========
WIN_ACTIVATE"title" Activate the window by the title.
WIN_ACTIVATE"" Activate the window under the mouse.
WIN_ACTIVATE Activate the top window.
WIN_ACTIVATE_NEXT Activate the next window.
Depth Arranging
===============
WIN_TO_FRONT"title" Move the titled window to the front.
WIN_TO_FRONT"" Move the active window to the front.
WIN_TO_FRONT Move the back window to the front.
WIN_TO_BACK"title" Move the titled window to the back.
WIN_TO_BACK"" Move the active window to the back.
WIN_TO_BACK Move the front window to the back.
WIN_BACK_TO_FRONT Move the back window to the front.
WIN_FRONT_TO_BACK Move the front window to the back.
Moving and Sizing
=================
WIN_MOVE"title,xxx,yyy" Move titled window to xxx,yyy.
Use +0 to leave a position alone.
WIN_MOVE"title,+-xxx,+-yyy" Move titled window + or - xxx yyy.
WIN_MOVE",xxx,yyy" Move active window to xxx,yyy.
WIN_MOVE",+-xxx,+-yyy" Move active window + or - xxx yyy
WIN_SIZE"title,xxx,yyy" Size titled window to xxx,yyy.
WIN_SIZE"title,+-xxx,+-yyy" Size titled window + or - xxx yyy.
WIN_SIZE",xxx,yyy" Size active window to xxx,yyy.
WIN_SIZE",+-xxx,+-yyy" Size active window + or - xxx yyy.
- 24 -
When sizing, an omitted number is assumed to be 0, which will leave
that dimension unchanged. When moving, a 0 will move to the pixel
coordinate 0. If it is omitted, it will not move in that dirrection.
For example:
WIN_MOVE",,200" Will move the active window to the Y coordinate
200 and the X position will not change.
WIN_MOVE",0,100" Will move the active window to the Y coordinate
100 and to the X coordinate 0.
If the requested size is to large for the window's position, the
window will be moved. If it is to large for the screen, the screen
size will be used. Finally, if it is to small, it will be ignored.
So, to make a full sized window, it is safe to use:
WIN_SIZE",1500,1500"
Organizing Windows
==================
WIN_LAYER - Arrange all windows on a screen in layers.
You'll need to try it to see what it actually
does. See the function SET_NO_LAYER"title,...".
The effect is something like this:
______________________________
|*| Utilities______________@|@|
|___________________________|_|
|*| System_________________@|@|
|___________________________|_|
|*| Tools__________________@|@|
| | |
| | |
| | |
|___________________________| |
|___________________________|/|
Simply put WIN_LAYER in a macro attached to a key combination like
Ctrl-Amiga-L.
Zooming Windows
===============
You can send the mouse to the zoom gadget and have the left mouse
button pressed and released with WIN_ZOOM. This function assumes that
the zoom gadget is just to the left of the front/back gadget. This
function also sets the "Relative Flag" if it is not already set.
If there is no zoom gadget in the targeted window, the function is
ignored.
- 25 -
Closing Windows
===============
WIN_KILL - Close the active window. This is NOT the same
as clicking on the close gadget. It actually
closes a window that may be owned by another
program. This function is included to provide a
way of closing an errant window that a program
left behind. USE WITH CAUTION! MAY CAUSE A
SYSTEM CRASH!
A useful macro to use this with his:
WIN_SELECT"Window To Kill?" WIN_KILL
See "WIN_SEND_CLOSE"" to send a close message.
Sending IDCMP Messages
======================
IDCMP messages (Intuition's Direct Communications Message Ports) are
the system's method of notifying a program that an event has taken
place. This event may be a close gadget, menu selection, key pressed
or released, or a gadget down or up message.
Many programs do not provide keyboard equivalents for menu selections.
With WIN_SEND_MENU",m,i,s", you can create your own!
You can send any IDCMP messages to any window that is able to receive
them. When a user clicks on the close gadget, for example, intuition
(part of the operating system) sends a special message to the program
that owns the window. The program then closes the window. MachIV can
also send these messages from macros. You may find it convenient to
create a close gadget macro attached to the hotkey Ctrl-Amiga-C or
Ctrl-Amiga-Q. Pressing this will then close the window.
You can easily send menu and gadget messages too. To send gadget
messages, you need to find out the desired gadget number. A program
called AllGadgets may be used to find these numbers. It must be run
from the shell while the window with the gadget in it is open.
Some programs need only the gadget up message while others need both
the down and up message. Some programs may also even need a pause
between the two.
Menu, menu item and menu subitem numbers start at 0. If you wish to
send a menu select message of the 2nd item in the 1st menu, you would
use the numbers 0,1.
In rare cases, the program that receives the message may not reply to
it and leave MachIV waiting forever. Simply press ESC.
- 26 -
Window Message Examples
=======================
WIN_SEND_CLOSE
Send Close gadget message to front window.
WIN_SEND_CLOSE""
Send Close gadget message to active window.
WIN_SEND_CLOSE"title"
Send Close gadget message to titled window.
WIN_SEND_MENU"title,0,2,1"
Send a menu selection to titled window,
menu number 0, item number 2, subitem
number 1.
Note! Console windows that have a close gadget are not expecting a
normal intuition message and so cannot be closed with WIN_SEND_CLOSE.
A console window is a special type of window that uses the console
device instead of intuition for its input and output. Shell windows
and "Ed" are two examples.
Window Selecting
================
WIN_SELECT Select a window from a list box and make it active.
Uses the default list box title "Select A Window".
WIN_SELECT"List Box Title"
Select a window from a list box and make it active.
Enclose your desired title in quotes.
If a window does not have a title, a pointer to that window will be
displayed in hexidecimal form. e.g. 0x7c5e3d0. If there is only one
unnamed window then it's usually easy to know which it is. Some
windows may have a blank title. If you don't see the title or pointer
in the list, try clicking where one might be in the list.
Screen Functions - SCR_
=======================
The screen functions operate in a similar manner to the window
functions. You can bring screens to the front or send them to the
back, you can select a screen from a list which will bring it to the
front and you can close an errant screen (cautiously!).
SCR_BACK_TO_FRONT - Send the back screen to the front.
SCR_TO_FRONT"title" - Send titled screen to the front.
SCR_FRONT_TO_BACK - Send front screen to the back.
SCR_TO_BACK"title" - Send titled screen to the back.
SCR_WB_TO_FRONT - Send Workbench screen to the front.
SCR_WB_TO_BACK - Send Workbench screen to the back.
- 27 -
SCR_SELECT - Select a screen from a list box using the
default list box title "Selet A Screen".
Bring the screen to the front.
SCR_SELECT"List Box Title"
- Select a screen from a list box using the
quoted title as the list box title.
Bring the screen to the front.
A pointer to the screen is displayed if there
is no title.
SCR_KILL - Request confirmation then close the front
screen. USE WITH CAUTION! Some programs
in some situations do not close their custom
screen when they terminate. This often
happens if the clock window is on it. With
this function, you can close it, but the
system may crash!
You can replace Workbench's standard combination Left-Amiga-N
with the macro SCR_BACK_TO_FRONT to bring the back screen (instead of
the Workbench screen) to the front. Replace Left-Amiga-M with
SCR_FRONT_TO_BACK. You can add WIN_ACTIVATE"" to these, which will
activate the window under the mouse after the screen is moved. Or use
WIN_ACTIVATE to activate the front window.
The macro might look like this:
SCR_BACK_TO_FRONT WIN_ACTIVATE""
Pausing Within A Macro - PAU_
=============================
Sometimes it is neccessary to pause during macro execution. There are
three types of pauses; pause for 0.1 - 99 seconds, pause for fixed
length input, and pause for variable length input. Examples:
PAU_SECONDS"1" Pause for one second.
PAU_SECONDS".3 Pause for .3 seconds.
PAU_SECONDS"2.5 Pause for 2.5 seconds.
PAU_FIX_INPUT"5" Pause for five keystrokes.
PAU_VAR_INPUT Pause for a variable number of keystrokes.
Terminate input with the ESC. To abort the macro
during input, press Ctrl-ESC.
PAU_VAR_INPUT"44" Pause for a variable number of keystrokes. The
hex number "44" is optional. When supplied, it is
the keycode to use to terminate input. In this
case, it is the Return key. The default key is
ESC. To abort the macro during input, press
Ctrl-ESC.
- 28 -
The input pause functions may be useful in data entry macros where
the macro performs some functions, waits for some user input, and
then continues with more functions. The macro may even call itself
over and over.
An easy way to setup such a macro would be to record a complete data
entry loop, and then, using SetMachIV, enter the pause in the
appropriate place.
A data entry macro might look like this:
MOU_XY"150,40" MOU_LBD MOU_LBU PAU_VAR_INPUT MOU_XY"460,23" MOU_LBD
MOU_LBU "\F1"
With this attached to the F1 key (for example), the mouse would click
at 150,40 (possibly a string gadget), wait for a variable number of
keystrokes followed by ESC, click at 460,23 (which might be a "Next"
gadget), and then execute F1 which would then cause it to repeat.
Graphics Functions - GFX_
=========================
An entire screen or a portion of it may printed using the macros:
GFX_SCREEN_PRINT and GFX_CUT_PRINT
To print a screen, just make that screen the front one and execute
the macro. To cut a portion of a screen, execute the macro and then
using the mouse, press the left button and drag until the desired
area is outlined.
There are two options in "Clip Features" - "Center Print Image" and
"Print Full Page". The first is self-explanatory, the second, when
checked, will expand the graphic image to fill the page.
Like all macro functions, you may abort by pressing ESC.
Executing Functions - EXE_
==========================
Macros may be automatically execution in several ways. Some use the
EXE_AUTO"" function and some execute based on the name of the macro.
Auto Execution Based On Time
============================
The general form is this:
EXE_AUTO"hh:mm,mm-dd-yy" or EXE_AUTO"hh:mm,Day,Day,..."
The arguments of this macro are optional, but when supplied indicate
the time and possibly the date or day that you wish the macro to
execute. Normal AmigaDos wild cards are allowed.
- 29 -
Examples:
EXE_AUTO"09:30" Execute at 9:30 am.
EXE_AUTO"14:45" Execute at 2:45 pm.
EXE_AUTO"??:15" Execute every 15 minutes.
EXE_AUTO"08:45,01-22-92" Execute at 8:45 am on January 22, 1991.
EXE_AUTO"19:00,??-10-??" Execute at 7:00 pm on the 10th of the month.
EXE_AUTO"11:00,Mon,Sat" Execute at 11:00 am every Monday and Saturday.
EXE_AUTO"12:00,Mon" Execute at 12:00 noon every Monday.
EXE_AUTO"" Execute when MachIV is first run.
This function is used in combination with other functions. For example:
EXE_AUTO"??:15" MSC_BEEP Will beep every 15 minutes.
EXE_AUTO"09:30,02-15-92" EXE_CMD"NewShell CON:220/50/200/50/Alarm"
"Call Joe" MSC_BEEP PAU_SECONDS"3" "\CxEndShell >nil:\N"
At 9:30 on 2-15-92, this will open a window in the center of the
screen, type the text "Call Joe", beep, pause 3 seconds, delete
(Ctrl-x) the text and end the CLI window. Note that text to be typed
is enclosed in double quotes.
EXE_AUTO"12:00" EXE_CMD"echo >speak: \"Lunch time. Why not take 2
hours?\""
Assuming that you have mounted the device speak:, at 12:00, speak the
quoted string. Note that double quotes within double quotes must be
preceeded by a backslash.
A popular combination of macros is this:
EXE_AUTO"??:15" MSC_BEEP
EXE_AUTO"??:30" MSC_BEEP PAU_SECONDS".5" MSC_BEEP
EXE_AUTO"??:45" MSC_BEEP PAU_SECONDS".5" MSC_BEEP PAU_SECONDS".5"
MSC_BEEP
EXE_AUTO"??:60" MSC_BEEP PAU_SECONDS".5" MSC_BEEP PAU_SECONDS"1"
MSC_BEEP PAU_SECONDS".5" MSC_BEEP
These will beep once at 15 after, twice on the half hour, three times
at three quarters after, and four times on the hour. These are 4
separate macros and may of course, be unkeyed.
If days are specified, they may be just long enough to match the day
that is displayed in the clock. That is, Tuesday, Tues, or even tu
will match Tuesday. Ranges are not supported. You must enter each
day. EXE_AUTO"11:30,Mon,Tue,Wed,Thu,Fri"
- 30 -
To enter these as unkeyed macros, click on "Select Hotkey" and press
Caps Lock when prompted. The current hotkey gadget should now show
"NO KEY" and all the qualifier gadgets should be disabled.
Now click on "Add Macro". The string gadget under the "Macros" list
box should be activated. Enter the first macro and press Return. The
macro should now be displayed in both the string gadget and in the
list box.
Click on "Add Macro" again and repeat these steps for the other three
macros.
Note that all macros that execute when MachIV is first run must be in
the first configuration.
Executing Programs
==================
Many programs can be run from a hotkey by simply putting
EXE_CMD"program"
in a macro. For example, EXE_CMD"run myapp" would run a program named
myapp. Usually, you would want to use Run in your command string to
keep from suspending MachIV during the application's execution.
The macro attached to Left-Amiga-ESC that opens a new shell is an
example of this kind of function.
SCR_WB_TO_FRONT EXE_CMD"NewShell \"con:0/0/640/100/NewShell\""
This macro first brings the Workbench screen to the front and then
executes the NewShell program. Note that the double quotes within
double quotes must be preceeded by a backslash.
Programs executed this way will have the same stack size as it was
set when MachIV was first run. Many programs need a larger stack than
the default 4000. You should set the stack in your startup-sequence
to at least 10000. You can check a program's icon to see what the
recommended size is for that particular program.
If you need a comma in the quoted string, use \, otherwise it will be
treated as an argument separator.
Using Templates
===============
Commonly used words and phrases may be automated by using the
MAC_FINISH function. If you often type "startup-sequence" for
example, you can create a macro "startup-sequence" (with the quotes)
with a name startup-seq. With MAC_FINISH attached to Left-Amiga-Space
bar, you could type: sta<Left-Amiga-Spacebar>
star<Left-Amiga-Spacebar> or start<Left-Amiga-Spacebar>
The rest will be typed for you. MachIV will remember upto 12
characters and it resets its counter whenever you press a
non-printable key or the spacebar.
- 31 -
Miscellaneous Functions - MSC_
==============================
Changing Directories
====================
Some programs require that you be in a specific directory before
executing the program. In these cases, you may temporarily change
directories with the MSC_CHG_DIR"path" function. For example:
MSC_CHG_DIR"dh0:games/arcade" EXE_CMD"Run SuperActionGame"
Changing Priorities Within A Macro
==================================
Programs may be run at different priorities by temporarily changing
MachIV's priority within a macro by using
MSC_PRORITY"nn"
Programs executed in the same macro after changing the priority will
have the new priority. After the macro is completed, the original
priority will be restored. An example:
MSC_PRORITY"4" EXE_CMD"run myapplication"
The priority of myapplication will be 4.
Text Functions - TXT_
=====================
Sending Date and Time
=====================
Formats:
TXT_TIME_PASTE or TXT_TIME_PASTE"am,pm"
TXT_TIME_PRINT or TXT_TIME_PRINT"am,pm"
TXT_DATE_PASTE or TXT_DATE_PASTE"long"
TXT_DATE_PRINT or TXT_DATE_PRINT"long"
The current date or time may be sent as keystrokes to an application
by using one of the _PASTE functions or to the printer using one of
the _PRINT functions.
The optional time function arguments "am,pm" cause the argument text
to follow the time. If the time is before noon, the first argument
will be sent otherwise the second is sent. This text may be anything
upto 80 characters. The optional date function argument "long" will
cause the long form of the date to be used like: January 17, 1992.
TXT_TIME_PASTE" ante meridiem, post meridiem"
The date format may be set in SetMachIV or with the function
SET_DATE_FORMAT"FMT". See the Clock chapter and the SET functions.
- 32 -
The Set Functions - SET_
========================
Some of MachIV's options may be set with the SET_ function. These
are usually used together with the EXE_AUTO"" function.
SET_SETMACHIV_PATH"path/file" - Set the name and path to use to
find SetMachIV.
SET_KEY"oldkey,newkey" - Change a key to another. This is
most often used for the middle mouse
button, but it could be any key. Use
the escape characters in Appendix B
for special keys and use \ML, \MM
and \MR for the mouse buttons.
SET_KEY"\MM,\S" Middle mouse button
to Shift key.
SET_KEY"\MM,\L" Middle mouse button
to Left-Amiga key.
Only 1 key or button may be changed.
SET_MONTHS"month1,month2,..." - Set the text to be used for month
names. Optional. Defaults to English.
SET_DAYS"day1,day2,..." - Set the text to be used for day names.
The first day is Sunday. Optional.
Defaults to English.
SET_DATE_FORMAT"FMT" - Set date format. Defaults to USA.
DOS File system format. 18-Feb-92
INT International. 92-02-18
USA United States. 02-18-92
CDN Canadian. 18-02-92
SET_DATE_SEPARATOR"/" - Set desired separator charactor.
"-" is default. e.g. 01-01-92
SET_NO_LAYER"title1,title2..." - Set the titles of windows NOT to
layer with WIN_LAYER. Maximum of 10
titles with 10 characters each.
The German macros might look like these:
EXE_AUTO"" SET_MONTHS"Januar,Febuar,Marz,April,Mai,Juni,Juli,August,
September,Oktober,November,Dezember"
EXE_AUTO"" SET_DAYS"Sonntag,Montag,Dienstag,Mittwoch,Donnerstag,
Freitag,Samstag"
- 33 -
Clipboard Functions - CLP_
==========================
The clipboard is a special software device used by many applications.
When you perform a copy or paste in the application, it copies the
text to the clipboard. This text is then available both to the
application that copied or cut it and to any other application that
uses the clipboard.
MachIV has several functions that enhance this feature. You may view
the contents of the clipboard, paste it to an application's window
that does not support the clipboard, and you may print its contents.
The clipboard supports multiple buffers or "units", up to 256. All
functions have an optional argument that specifies the clipboard unit
to use. If you do not provide the argument, unit 0 or the last unit
selected will be used.
CLP_VIEW
CLP_VIEW"nnn"
Open a window and display the contents of the clipboard. From the
viewer window, the unit number may be changed by entering a number in
the string gadget, by clicking on the up/down gadgets, or by pressing
a key from "0" - "9". Re-read the clipboard by pressing the current
unit number. Close the view window with either the close gadget or by
pressing Return. Pause the display by pressing any other key. The
viewer window will automatically update itself when the contents of
the current unit have changed.
The view window may be kept opened if desired and zoomed to a large
or small size. MachIV will function normally while it is open.
CLP_PASTE
CLP_PASTE"nnn"
This function will paste the contents of the clipboard to the active
window. You would normally use this to paste to a window that does
not provide clipboard support, or to one that only supports unit #0
and you want to paste from a different unit. You can even paste to a
string gadget!
This function sends the text as keystrokes so it may not be very
speedy. The "Burst Chars" gadget in the "Clip Features" window may be
set as high as 80. Text is pasted using this setting only if "Append
Chars", "Prepend Chars" and "Char Delay" are set to null or 0. In
this case, only keypress down messages are sent. If your application
that is receiving the text needs keypress up messages also, set "Char
Burst" to 0.
The two strings in the gadgets "Prepend" and "Append" will be sent
before and after each line. The delay between characters and lines
sent are of interest mainly to telecommunication users. They are in
50ths of a second.
You can remove linefeeds when pasting a paragraph by checking "Remove
Line Feeds" in SetMachIV and you can send both a return and line feed
for each line feed by checking "Line Feeds To CRLF".
- 34 -
CLP_PRINT
CLP_PRINT"nnn"
This function will print the contents of the clipboard. Most word
processors provide this ability, but now you can print text from the
shell. In a shell, you can select text with the mouse and press
Right-Amiga-C to copy it to the clipboard. CLP_PRINT could then be
used to print it, or CLP_PASTE to paste it.
Notes:
------
To abort printing or pasting, press ESC.
You can use multiple buffers when using an editor like Ed that uses
a console window. A set of macros (attached to perhaps the numeric
keypad) might be these:
EXE_CMD"ConClip 0"
EXE_CMD"ConClip 1"
EXE_CMD"ConClip 2"
By executing one of these, you can quickly change which unit the
console copy and paste commands will use.
Currently, only text of the IFF type FTXT CHRS may be viewed. ILBM
support will be added later.
A copying to the clipboard function is not supported as that involves
a considerable amount of code for outline character recognition. If
you want that ability, use one of the "Snip", "Snap" or "OSnap" type
utilities.
Note that you can also print graphics with GFX_CUT_PRINT and
GFX_SCREEN_PRINT.
- 35 -
Chapter 7 Configurations
=====================================================================
You may have more than one configuration within your MachIV.prefs
file.
Instead of having settings and macros for one application saved in
one file and other settings and macros saved in another file, they
can be combined into one file and can be made active simply by
clicking in a window.
Let's assume that you've set some macros attached to function keys
and other features that work well in a shell. Now you want to run an
application program such as WordPerfect which uses the function keys.
You could disable all macros while using WordPerfect, but there is
another alternative. You can add another configuration to the one
that you have already set up and modify it to work with WordPerfect.
To do this, select "Add" in SetMachIV. This will make a duplicate
configuration and number it 2. Clear your macros that are attached to
the function keys, if desired. Next in the string gadget under the
small list box to the left of "Add", type in " WordP" without the
quotes. (Notice the space before the WordP, that's like it is in the
title bar).
In your first configuration, you could type in the title AmigaShell
or whatever is in the title bar of your shell. Now, when you click in
a WordPerfect window, the second configuration becomes active. Click
in your shell window and its configuration becomes active.
If you are using the SunMouse feature you do not need to click in the
window - the configuration will become active when the window becomes
active. A configuration will also become active when you press any
key. For example, if you start an application which opens an active
window, the configuration will not become active until you do one of
the following:
1. Click in the window.
2. Press any key.
3. Move the mouse (if the SunMouse is on).
Changing Configurations
=======================
You may have as many configurations as you like. Each one may be
attached to a window or screen through its title. The title need be
just long enough to uniquely match a window's title.
An "@" symbol as the first character will lock a configuration which
may then only be changed from SetMachIV or by executing a macro with
a CFG_ function such as CFG_NEXT. (see Appendix A). When a
configuration is changed from within a macro, there will be no
further execution of that macro.
- 36 -
You may put in multiple window titles separated by a "|" vertical bar
(next to the Backspace key) such as "Ashell|TextEd| WordP" up to a
maximum of 40 characters. This example shows a configuration that
will become active when you click in a window titled Ashell, TextEd,
or WordP.
When a new configuration is made active, its title will appear in the
clock for about one second.
If the clock is identical to the clock in the previously active
configuration, it will not be closed and reopened when configurations
are changed.
Default Configuration
=====================
The first configuration with no title will be activated when no title
matches. This means that you can set up a default configuration with
no title that will be active when you click in a window that does not
match any of your configuration titles.
Windows And Screens With No Title
=================================
Not all windows or screens have real titles. It may be just text
written where the title should be. MachIV cannot locate these titles
and thus cannot change to the proper configuration automatically. You
can manually change to these configurations with a CFG_NEXT or
CFG_CHANGE"title" macro.
Attaching To The Program's Name
===============================
You may be able to change to untitled windows by specifying the
program's name. Do this by prefacing the program name with the "$"
symbol. For example: a configuration titled "$dh0:DPaint" will become
active when you click in the Deluxe Paint window. Unfortunately, not
all program names are accessible. Programs started from Workbench do
not have accessible names.
A program supplied with MachIV call AllTitles will list the window
and screen titles and program names that are useable. Simply type
AllTitles at the CLI prompt.
Adding And Deleting
===================
"Add" duplicates the current configuration and then makes that one
current. You may then delete or modify macros and other settings in
the new configuration.
Delete a configuration with the "Del" gadget. You cannot delete the
last configuration.
- 37 -
Loading And Saving
==================
For any changes to be permanent, you just need to select "Save" or
"Save As..." from the "Project" menu. When MachIV is first run, it
looks for MachIV.prefs from the command line or Tool Types, then from
the current directory. If it is not found, it tries to load
ENVARC:MachIV/MachIV.prefs. You may save settings to other file
names, but only one of these two will be loaded automatically.
Select "Open..." from the "Project" menu to load other settings
files.
The Settings File
=================
This section describes the settings file itself. Most users will not
need to do anything to it.
The MachIV.prefs file is straight ASCII text and may be edited (but
does not need to be). Multiple configurations are all saved together
under one file name. Each configuration within this file must start
with ID=4.0. The specific order of everything else is not important.
Long lines are broken into smaller lengths (252 characters) and
terminated with a backslash. These allows some text editors that
cannot handle long lines to be used to edit a settings file.
Macros must be in the following format:
Macro=qualifiers key{macroname}[XX]Macro body
The keys and qualifiers are identified in Appendix B. The name should
be no more than 12 characters. To enter no name use {}. The [XX] is
the hexidecimal repesentation of the selected flags.
Examples:
=========
Macro=\Lj{WinToFront}[00]WIN_BACK_TO_FRONT
This is Left-Amiga-J Window to front hotkey.
Macro=\L\E{NewShell}[80]SCR_WB_TO_FRONT EXE_CMD"NewShell
\"con:0/0/640/100/NewShell\""
This is Left-Amiga-ESC and executes a newshell command.
Macro=\A\E{StartStop}[80]MAC_RECORD_KEYED
This is Alt-ESC and begins or ends a "recording to key" recording
session.
- 38 -
Chapter 8 Miscellaneous Features
=====================================================================
These features are accessible from the "Miscellaneous Features"
window.
Priorities
==========
All tasks in the Amiga's multitasking operating system run at a
particular priority. Higher priority tasks have higher numbers and
will run while tasks with lower priorities wait. Most user tasks run
at a priority of 0 and have an equal share of time. MachIV runs
well at 1. MachIV also has the ability to change its priority
temporarily while playing back a macro. A priority of 1 is usually ok
here too. You may experiment with these numbers and your particular
applications to find what works best. Don't try to set them very high
though, usually no more than 6 and certainly no more than 10. By
setting the "Playback Priority" to 0, the application and MachIV will
alternate between sending and receiving. The playback priority may
also be temporarily changed from a macro with MSC_PRIORITY. See
Appendix A.
Screen Blanking
===============
After a preset length of time, you may have the screen either go
blank or just dim. If you select a dimness of 0 and have Check Waltz
on, there will be two dancing check marks on the blanked screen. You
may adjust the tempo with the keys 1-9.
If you select a dimness value of 1-15, the front screen will go dim.
This uses no extra memory because it doesn't open a black screen.
The screen may also be blanked with MSC_BLANK_SCREEN in a macro.
Executing this macro will immediately blank the screen.
By selecting "Quick Blank" and setting some value for the "Mouse Off"
feature, the screen can be blanked when the mouse turns off by first
moving the mouse to the upper left corner.
Macro Screen Blanking
=====================
If you wish, you can execute a macro named "Blank" instead of
blanking the screen. With this feature, you could execute an
animation or anything else. In addition, you could send a message to
a custom screen blanker telling it to blank. The function
MSC_PUTMSG"xx,xx,xx" could be used for this. A sample screen blanking
program is included. This requires some knowledge of "C".
If a macro was executed instead of the normal screen blanking, a
macro named "Unblank" will execute when the user presses a key or
moves the mouse.
- 39 -
A macro named "MachIVQuit" will execute when MachIV is terminated.
This could be used to send a message to a screen blanker telling it
to quit.
Suspend
=======
MachIV may be temporarily suspended by clicking on the Suspend
gadget. Or, you may create a macro that has a MSC_SUSPEND function.
Pressing the hotkey that this macro is attached to will either
suspend or activate MachIV.
Remove
======
You can remove MachIV completely by clicking on "Remove MachIV".
MSC_QUIT in a macro may also be used. You may also remove MachIV by
running it again from your shell or double clicking on its icon. Yet
another way is to send it a "break" command or activate the clock and
press Ctrl-C.
Check Waltz
===========
When you have selected 0 in "Blanking Dimness", and you have "Check
Waltz" on, screen blanking will include two dancing check marks. The
speed of these may be adjusted with the keys 1 to 9.
No Caps Lock
============
Selecting "No Caps Lock" on will disable your Caps Lock key. It
actually may be still used by pressing Left-Amiga-CapsLock.
Beeping
=======
MachIV will beep to prompt you for certain actions, when you set an
alarm or when you execute a macro that has MSC_BEEP in it.
You can use a custom sound for MachIV's beep. Enter the name and
complete path of the sound file in the "Beep File Name" gadget. The
sound may be an IFF 8SVX sound file or a raw data file with the file
size in bytes 1 to 4 and the period value in bytes 5 and 6. Many
sound digitizing programs provide the ability to save in a "raw
format". Several samples of both are provided. The sound file should
be as small as possible. Less than 500 bytes is recommended although
you could use upto 3000 to 4000 byte files.
This sound is not the sound used when recording macros.
The sound is repeated 6 times for the alarm.
You may specify the number of beeps with MSC_BEEP"nn" such as:
MSC_BEEP"1" MSC_BEEP"4"
- 40 -
Hold Qualifiers
===============
If "Hold Qualifiers" is checked, you may press and release any
qualifier and it will be remembered and added to the next
non-qualifier key or mouse button. The "held" qualifiers will then be
released. See below for holding for multiple keystrokes.
Many disabled people find it difficult if not impossible to type key
combinations such as Ctrl-Shift-F1. So you could for example, press
Ctrl, Shift, and then F1. The Ctrl and Shift would be added to the F1
just as if they were pressed at the same time.
This feature is not intended for someone who doesn't need it as it
sometimes may cause unexpected results. For example, if you press
Alternate and then change your mind, the Alternate will still be
added to the next key pressed. Pressing Caps Lock or the right mouse
button will clear the qualifiers. Pressing a qualifier again will
clear that qualifier.
The first letter in the clock will change to a white (or whatever
color is used in pen 2) "A" when there are qualifiers accumulating.
Qualifiers may be held for multiple keystrokes if you first press
Alt-CapsLock.
This may also be used with Workbench's extended selection. Press the
Shift key, then click on your icons.
Press any non-qualifier key or the right mouse button to clear the
qualifiers that have been accumulating.
Debug
=====
With this feature checked, MachIV will be in the debugging mode. When
a macro is executed and for some reason fails, SetMachIV will be run
and the offending macro will be displayed with the cursor on the
function that failed.
- 41 -
Appendix A Special Functions
=====================================================================
Configuation Functions
=====================================================================
CFG_CHANGE"title" Change to a configuration with the
title "title".
CFG_LOAD"path/filename" Load a settings file.
CFG_NEXT Make the next configuration active.
CFG_SAVE"path/filename" Save a settings file.
Clock Functions
=====================================================================
CLK_CUSTOM_MSG"Message" Display a message in the clock. You could
combine this with another function to
tell you what happened. For example:
SET_DATE_FORMAT"INT" CLK_CUSTOM_MSG"Date format set."
CLK_ON_OFF Turn the clock on or off.
CLK_OFF Turn the clock off.
CLK_ON Turn the clock on.
CLK_TO_FRONT Send the clock to the top screen.
Clipboard Functions
=====================================================================
All clipboard functions have an optional argument that specifies the
clipboard unit to use. If you do not provide the argument, unit 0 or
the last unit selected will be used.
CLP_VIEW Open a window and display the contents of
CLP_VIEW"nnn" the clipboard.
CLP_PASTE Paste the contents of the clipboard to the
CLP_PASTE"nnn" active window. You would normally use this
to paste to a window that does not provide
clipboard support, or to one that only
supports unit #0.
CLP_PRINT Print the contents of the clipboard.
CLP_PRINT"nnn"
- 42 -
Execute Functions
=====================================================================
The standard AmigaDos wild cards ? and # may be used in these
arguments.
EXE_AUTO"hh:mm,mm-dd-yy" Automatically execute a macro at a
specific time and date.
EXE_AUTO"hh:mm,day,..." Execute at a specific time and day.
EXE_AUTO"hh:mm" Automatically execute a macro at a
specific time.
EXE_AUTO"" Execute when MachIV is first run.
Graphics Functions
=====================================================================
GFX_CUT_PRINT Cut and print a graphic image.
GFX_CUT_PASTE Cut and paste a graphic image. Abort
printing by pressing ESC.
GFX_CUT_SAVE Cut and save a graphic image. (Not
implemented yet!)
GFX_SCREEN_PRINT Print the entire screen. Abort
printing by pressing ESC.
GFX_SCREEN_SAVE Save the entire screen. (Not
implemented yet!)
Maro Functions
=====================================================================
MAC_SELECT_NAMED"Title" Open a list box to select a macro name from
and execute that macro. "Title" is
optional. It replaces the default "Select A
Name" title.
MAC_EXECUTE_NAMED"name" Execute a macro named "name".
MAC_FINISH Finish executing a macro based on
characters already typed that match the
macro's name.
MAC_ON_OFF Turn macros on or off.
MAC_RECORD_KEYED Start or stop recording to a hotkey.
MAC_RECORD_NAMED Start or stop recording to named macro.
MAC_SHOW Show a macro.
Mouse Functions
=====================================================================
MOU_LBD Send a left button down.
MOU_LBU Send a left button up.
MOU_MBD Send a middle button down.
MOU_MBU Send a middle button up.
MOU_RBD Send a right button down.
MOU_RBU Send a right button up.
MOU_XY"xxx,yyy" Move the mouse to xxx,yyy.
MOU_OFF"nn" Set the "Mouse Off" seconds.
MOU_SPEED"nn" Set the "Mouse Speed".
MOU_THRESHOLD"nn" Set the "Mouse Threshold".
MOU_SUN Turn the "SunMouse" on or off.
MOU_TO_MENU Turn "Mouse To Menu" on or off.
- 43 -
Miscellaneous Functions
=====================================================================
MSC_BEEP"nn" Sound an audible beep. Argument is optional.
MSC_BLANK_SCREEN Blank the screen.
MSC_CHG_DIR"path" Change directories.
MSC_HOLD_QUALS Turn "Hold Qualifiers" on or off.
MSC_PRIORITY"nn" Set the priority for the rest of the macro.
MSC_QUIT Terminate MachIV.
MSC_SET_FLAGS"xx,name" Toggle the flags xx for macro "name".
80 = Write Protect, 40 = Disable,
20 = Temporary, 10 = Relative.
MSC_SUSPEND Suspend MachIV.
MSC_SPEAK_ON_OFF Turn the speaking of messages on or off.
MSC_PUTMSG"port,xx,xx,xx" Send a message to a message port.
MSC_DEBUG_ON_OFF Turn debugging on or off.
Pause Functions
=====================================================================
PAU_SECONDS"n.n" Pause for n.n seconds.
PAU_FIX_INPUT"nn" Pause for nn keystrokes.
PAU_VAR_INPUT"xx" Pause for variable number of keystrokes.
Optional "xx" is the hexidecimal code for
a terminating keycode. Default is ESC.
Screen Functions
=====================================================================
SCR_BACK_TO_FRONT Send the back screen to the front.
SCR_TO_FRONT"title" Send titled screen to the front.
SCR_FRONT_TO_BACK Send front screen to the back.
SCR_TO_BACK"title" Send titled screen to the back.
SCR_WB_TO_FRONT Send Workbench screen to the front.
SCR_WB_TO_BACK Send Workbench screen to the back.
SCR_SELECT Select a screen from a list box using the
default list box title "Selet A Screen".
Bring the screen to the front.
SCR_SELECT"title" Select a screen from a list box using the
quoted title as the list box title.
Bring the screen to the front.
SCR_KILL Request confirmation then close the front
screen. USE WITH CAUTION! Some programs
in some situations do not to close their
custom screen when they terminate. With
this function, you can close it, but the
system may crash!
- 44 -
Set Functions
=====================================================================
SET_SETMACHIV_PATH"path/file" Set the name and path to use find
SetMachIV.
SET_MONTHS"month1,month2,..." Set the text to be used for month
names. Optional. Defaults to English.
SET_DAYS"day1,day2,..." Set the text to be used for day
names. The first day is Sunday.
Optional. Defaults to English.
SET_DATE_FORMAT"FMT" Set date format. Defaults to USA.
May also be set in SetMachIV.
DOS File system format. 18-Feb-92
INT International. 92-02-18
USA United States. 02-18-92
CDN Canadian. 18-02-92
SET_DATE_SEPARATOR"/" Set desired separator charactor.
"-" is default. e.g. 01-01-92
May also be set in SetMachIV.
SET_NO_LAYER"title1,title2..." Set the titles of window NOT to layer
with WIN_LAYER. Maximum of 10 titles.
10 characters each.
SET_KEY"key,key" Set a key to another. Most often the
middle button to the shift key.
SET_KEY"\MM,\S"
Text Functions
=====================================================================
Use "long" to use the long form of the date.
Use "am,pm" to send the appropriate text with the time.
TXT_DATE_PASTE Paste the current date.
TXT_DATE_PRINT Print the date.
TXT_TIME_PASTE Paste the time.
TXT_TIME_PRINT Print the time.
Window Functions
=====================================================================
WIN_ACTIVATE"title" Activate the window by the title.
WIN_ACTIVATE"" Activate the window under the mouse.
WIN_ACTIVATE Activate the top window.
WIN_ACTIVATE_NEXT Activate the next window.
WIN_TO_FRONT"title" Move the titled window to the front.
WIN_TO_FRONT"" Move the active window to the front.
WIN_TO_FRONT Move the back window to the front.
WIN_TO_BACK"title" Move the titled window to the back.
WIN_TO_BACK"" Move the active window to the back.
WIN_TO_BACK Move the front window to the back.
- 45 -
WIN_BACK_TO_FRONT Move the back window to the front.
WIN_FRONT_TO_BACK Move the front window to the back.
WIN_MOVE"title,xxx,yyy" Move titled window to xxx,yyy.
Use +0 to leave a position alone.
WIN_MOVE"title,+-xxx,+-yyy" Move titled window + or - xxx yyy.
WIN_MOVE",xxx,yyy" Move active window to xxx,yyy.
WIN_MOVE",+-xxx,+-yyy" Move active window + or - xxx yyy
WIN_SIZE"title,xxx,yyy" Size titled window to xxx,yyy.
WIN_SIZE"title,+-xxx,+-yyy" Size titled window + or - xxx yyy.
WIN_SIZE",xxx,yyy" Size active window to xxx,yyy.
WIN_SIZE",+-xxx,+-yyy" Size active window + or - xxx yyy.
WIN_ZOOM"title" Click the left mouse button over the zoom gadget of
the titled window.
WIN_ZOOM"" Click the left mouse button over the zoom gadget of
the active window.
WIN_ZOOM Click the left mouse button over the zoom gadget of
the top window.
WIN_SEND_CLOSE Send Close gadget message to front window.
WIN_SEND_CLOSE"" Send Close gadget message to active window.
WIN_SEND_CLOSE"title" Send Close gadget message to titled window.
WIN_SEND_GADGET_DOWN",7" Send gadget down message to active window
gadget number 7.
WIN_SEND_GADGET_DOWN"title,19"
Send gadget down message to titled window
gadget number 19.
WIN_SEND_GADGET_UP",34" Send gadget up message to active window
gadget number 34.
WIN_SEND_GADGET_UP"title,g"
Send gadget up message to titled window
gadget number g.
WIN_SEND_MENU",m,i,s" Send a menu selection to active window,
menu number m, item number i, subitem
number s (optional).
WIN_SEND_MENU"title,0,2,1"
Send a menu selection to titled window,
menu number 0, item number 2, subitem
number 1.
WIN_SEND_OTHER"title,xx,xx,xx"
Send any other IDCMP message to the titled
window. The 1st argument is the message
class, the 2nd is the code and the last is
the qualifier. All are in hex.
- 46 -
WIN_SEND_OTHER",xx,xx,xx"
Send any other IDCMP message to the active
window.
WIN_SELECT Select a window from a list box and make
it active. Use default list box title
"Select A Window".
WIN_SELECT"List Box Title"
Select a window from a list box and make
it active. Enclose your desired title in
quotes.
- 47 -
Appendix B Escape Characters
=====================================================================
Note that all are upper case except the arrow keys.
Function Keys
-------------
\F1 Function key 1 \F4 Function key 4 \F7 Function key 7
\F2 Function key 2 \F5 Function key 5 \F8 Function key 8
\F3 Function key 3 \F6 Function key 6 \F9 Function key 9
\F10 Function key 10
Numeric Keypad Keys
-------------------
\1 Numeric Keypad 1 \4 Numeric Keypad 4 \7 Numeric Keypad 7
\2 Numeric Keypad 2 \5 Numeric Keypad 5 \8 Numeric Keypad 8
\3 Numeric Keypad 3 \6 Numeric Keypad 6 \9 Numeric Keypad 9
\10 Numeric Keypad 10
\- Numeric Keypad - \* Numeric Keypad *
\e Numeric Keypad ENTER \+ Numeric Keypad +
\( Numeric Keypad ( \/ Numeric Keypad /
\) Numeric Keypad ) \. Numeric Keypad .
Other Special Keys
------------------
\B Backspace \u Up Arrow
\D Delete \d Down Arrow
\E Escape \l Left Arrow
\H Help \r Right Arrow
\N Return (Newline)
\T Tab
\\ Backslash
Qualifier Keys
--------------
\A Alternate
\C Control
\S Shift
\L Left Amiga
\R Right Amiga
- 48 -
Appendix C Common Questions
=====================================================================
Q. Why can't I close my CLI window after running MachIV?
A. Use Run >nil: MachIV. This will allow the CLI window to
close.
Q. Why does MachIV seem to stop functioning after I run an
application from a EXE_CMD"program" macro?
A. Unless you use "Run" in the macro, MachIV will wait for
the application to terminate. You should use something
like EXE_CMD"Run MyProgram".
Q. Why does my application crash when I run it from the
NewShell or from an EXE_CMD"" macro?
A. Programs executed with EXE_CMD (such as NewShell) will
have a stack the size that was set when MachIV was run.
These and ones that you may run from a new shell may need
a larger stack. Either set the stack before running
MachIV, or after you create a NewShell use the stack
command to set your stack to a larger value. The default
stack size is 4000. Many programs need 10000 or more.
Q. Why does my EXE_CMD function return an error code?
A. If you are trying to start a program from a macro and you
have entered the command as you normally would type it
from the shell, the problem is often embedded quotes,
commas or backslashes. For example, use:
EXE_CMD"echo >speak: \"time for lunch\, now!\""
Not:
EXE_CMD"echo >speak: "time for lunch, now!""
An error code is also returned if the program cannot be
found. It is often helpful to turn "Speak Messages"
and "Debug" on when trying to locate these problems.
Q. Why am I in the c: directory when I create a New Shell?
A. MachIV's current directory is the one that was current
when MachIV was run. If you bring up a New Shell and find
yourself in the c: directory for example, it is because
that was the current directory when MachIV was run. You
probably did a "cd c:" somewhere before running MachIV.
- 49 -
Q. Why am I getting a Close Screen Vector message?
A. The clock options "Any Screen" and "Top Screen" replace
the CloseScreen vector with one that will allow MachIV
to close its clock window. Selecting "WB Screen" or
removing MachIV will put back the original vector. If
another program also replaced the vector, you will be
given the opportunity to terminate that program before
the original vector is replaced. If you get a requester
with the message Close Screen Vector Was Changed!, either
terminate the program that changed the vector and click
Retry or just click Cancel. If "WB Screen" is selected,
the vector is not changed unless you have used the
clipboard viewer on a custom screen.
Q. How can I display only the total memory in the clock?
A. You can fool the clock into displaying your total memory
even if you have fast ram. In your startup-sequence, turn
off your fast ram with a command like "NoFastMem", run
MachIV, then run "NoFastMem" again.
- 50 -
Appendix D Graphic Print Options
=====================================================================
GRAPHIC PRINTING OPTIONS
You can follow GFX_SCREEN_PRINT and GFX_CUT_PRINT with some printing
options. They are:
GFX_SCREEN_PRINT"x,y,w,h,c,r,xxx"
and
GFX_CUT_PRINT"c,r,xxx"
These all are decimal numbers except the last which is hex.
x = The horizontal pixel to start printing from. Not used in CUT.
y = The vertical pixel to start printing from. Not used in CUT.
w = The width of the graphic. Not used in CUT.
h = The height of the graphic. Not used in CUT.
c = Columns to be printed.
r = Rows to be printed.
xxx = Special functions listed below.
SPECIAL_MILCOLS 001 c is specified in 1/1000"
SPECIAL_MILROWS 002 r is specified in 1/1000"
SPECIAL_FULLCOLS 004 make c maximum possible
SPECIAL_FULLROWS 008 make r maximum possible
SPECIAL_FRACCOLS 010 c is fraction of FULLCOLS
SPECIAL_FRACROWS 020 r is fraction of FULLROWS
SPECIAL_CENTER 040 center image on paper
SPECIAL_ASPECT 080 ensure correct aspect ratio
SPECIAL_DENSITY1 100 lowest resolution (dpi)
SPECIAL_DENSITY2 200 next res
SPECIAL_DENSITY3 300 next res
SPECIAL_DENSITY4 400 next res
SPECIAL_DENSITY5 500 next res
SPECIAL_DENSITY6 600 next res
SPECIAL_DENSITY7 700 highest res
SPECIAL_NOFORMFEED 800 don't eject paper on gfx prints
Special function overrides "Center Print Imiage" and "Print Full Page"
in "Clip Features".
Full screen examples:
GFX_SCREEN_PRINT",,,,0,0,0" Print full width with correct aspect.
Both a 320 or 640 wide screen will fill
the page.
GFX_SCREEN_PRINT"0,0,640,400,0,0,4" Print using maximum columns.
GFX_SCREEN_PRINT"0,0,640,400,0,0,8" Print using maximum rows.
GFX_SCREEN_PRINT"0,0,640,400,640,400,40" Center the picture.
GFX_SCREEN_PRINT"0,0,640,400,,,80" Use correct aspect.
- 51 -
For clipped graphics, x,y, w,h are filled in for you when you clip
the graphic image. You may supply c, r and xxx.
GFX_CUT_PRINT"0,0,40" Center clipped graphic.
GFX_CUT_PRINT"0,0,80" Use correct aspect.
GFX_CUT_PRINT"0,0,C0" Center clipped graphic and use correct aspect.
(80 + 40 = C0 in hex).
GFX_CUT_PRINT"0,0,84" Print with maximum width possible.
GFX_CUT_PRINT"1000,500,103" Print 1" wide, 1/2" tall, lowest density.
Examples (last option must be 0):
GFX_SCREEN_PRINT"0,0,320,200,640,400,0" Source is 320x200 but print
using 640x400.
GFX_SCREEN_PRINT"0,0,320,200,0,200,0" Use maximum columns and 200
rows.
GFX_SCREEN_PRINT"0,0,320,200,0,0,0" Allow printer driver to
determine aspect.
GFX_SCREEN_PRINT"0,0,320,200,320,0,0" Use 320 columns and allow
printer driver to determine
rows.
GFX_CUT_PRINT"0,0,0" Print graphic using the largest possible
size while maiintaining correct aspect
ratio.
- 52 -
Appendix E Some Useful Macros
=====================================================================
The following are some macros that you might find useful. The
suggested hotkeys may, of course, be changed to your own preferences.
---------------------------------------------------------------------
Attach this to Ctrl-Amiga-A to send Workbench the Show All Files menu
selection.
WIN_SEND_MENU",1,7,1"
---------------------------------------------------------------------
Attach this to Ctrl-Amiga-Q to close the active window.
WIN_SEND_CLOSE""
---------------------------------------------------------------------
Attach this to an easy to remeber key to start your word processor.
MSC_CHG_DIR"dh1:FinalCopy" EXE_CMD"Run FinalCopy -cl"
---------------------------------------------------------------------
C programmers might like this attached to Left-Amiga-F.
"for (i=;i<;i++) {\l\l\l\l\l\l\l\l\l\l"
And this attached to Left-Amiga-P.
"printf(\"\n\" );\l\l\l\l\l\l"
This will output a commented $VER: statement.
"/* $VER: ()\l" set_date_separator"." txt_date_paste
set_date_separator"-" "\r\N *\N*/\u\u\S\r\S\u\r\r\r\r"
It will look like this: (with cursor before the (01.01.92))
/* $VER: (01.01.92)
*
*/
(Use SET_DATE_FORMAT"CDN" to output dd.mm.yy instead of mm.dd.yy)
---------------------------------------------------------------------
Give this a name of 640x200 and execute it by name to change
screenmode and overscan. (This is all one macro)
EXE_CMD"overscan sys:prefs/presets/overscan640x240.prefs use"
EXE_CMD"screenmode sys:prefs/presets/screenmode640x240.prefs use"
---------------------------------------------------------------------
Name this "Kill Screen". CAUTION! This will crash unless the screen is
REALLY lonely.
SCR_SELECT"Screen To Kill?" SCR_KILL