AGAlloc count in attached process (displays message with heap statistics)'Can be used to check for memory leakage LPC & ATSd
B#Send attached process to Background1Can be used to force registration of "Bring" data LPC & ATS
C.Send a "Closedown" message to attached process8Same as pressing "Del" in System screen; error if "busy"
LPC & wSendCommandL
EExpression=Evaluate the given expression and send it as a string of keys<Eg put "%p" in the expression to be replaced by process name
LPCAAllowed substitutions are: "%p" for process name (DatCommandPtr),7"%f" for family ("alias") name (DatProcessNamePtr), andD"%s" for status name (DatStatusNamePtr - as shown in status windows)j
F$Bring attached process to Foreground6Commonly used after changing which process is attached LPC & ATSw
G.Ensure attached process is in its Ground state3Effectively repeatedly sends "Esc" key, as required
LPC & IPC & ATS
HDylNameKHave attached process load and Hook named DYL (best to give full path name)FEg "H\DYL\Register.dyl" where drive will be taken from Kmac's location
LPC & wSendCommand
IInfoMessageTextADisplay given Info message in top left corner of attached processHEg "IAbout to change sound value"; empty message clears any existing one LPC & ATS
Jm,nBJump the next n steps if a condition is true or (m negative) false=Can be used to omit a certain step if eg no dialog is showing
LPC & IPC & KMAC?Bits that can be set in "m" to test for various conditions are:-1 for a menu showing, 2 for a dialog showing,:4 for DatLocked non-zero, 8 for a keyboard filter in place916 for non-negative i/o semaphore, 32 for nested am_start#n defaults to 1 and can be omitted;Yif n is zero, jumps back to start of current script (or to top of macro if not in script)
Kk,m@Send Keypress with keycode k and modifier m (m defaults to zero)=Eg "K27" to send an "Esc" keypress, or "K27,4" for "Ctrl-Esc" LPC & ATS
Ln<Link paste ("bring") up to n characters, as a string of keysPIf n is omitted, up to 128 available characters (in first paragraph) are brought
LPC & IPC & ATS
Mm,nADisplay mth Menu with highlight on nth item (zero-based counting)8Eg "M2,1" to display "Install standard" in System screen
LPC & IPC & ATS
Ntitle,subtitle<Present a Notify-style "alert" dialog with a continue button2Has one or (if subtitle present) two lines of text
LPC & ATS & KMAC
PmKPause for m tenths of a second inside attached process (m defaults to zero)#Can be used to let redraws catch up LPC & ATS
Qtitle,question=Present a Query dialog with given title and optional question0Set "%d" variable to 1 for "Yes" and 0 otherwise
LPC & ATS & KMAC5Test for "%d" in subsequent "d" or "r" or "x" command
SStringESend a String of printable or (prefixed by ^ or @) interpretable keys1Eg "S@z123^C" sends Psion-z then "123" then ENTER LPC & ATSQInterpretable keys prefixed by ^ are: Up, Down, Left, Right, Home, End, Tab, Menu2C for Return, X for Escape, P for PgUp, Q for PgDnG? for current drive "letter" (A or I or B), + for Diamond, - for Delete@0 to 9 to pause for 0 to 9 seconds, and % to pause half a secondHY to yield CPU until all other background and foreground processes pause=Prefix a key with @ to simulate a Psion or Shift-Psion hotkey7Eg @z for Psion-z or @Z for Shift-Psion-z; use @@ for @EOr put @<digit> to set modifier for next key in string (0 by default)VThus S@4^U to send Ctrl-Up keypress (for these purposes PSION_MOD is 1 not 8 as usual)
aProcess4Attach to first process matching given specificationEEg "aSYS$SHLL.*" to attach to System screen (process name "SYS$SHLL")
LPC-Catch any error by using a prior "e" command.>
Beep (same as in Opl)
Useful when debugging macros
cCommandLine9Prepare Command line (or other stored line) for later useAEg "cCProgram#.OPL OROPO#LOC::M:\OPL\TLPC.OPL#" (#'s become \0's)
d dFilenameTOptionally Divert to filename formed from name of attached app or from "%d" variableAEg put "%p" in the passed filename to be replaced by process name
KMACEIf filename formed in this way does not exist, just skip to next lineAAllowed substitutions are: "%p" for process name (DatCommandPtr),3"%f" for family ("alias") name (DatProcessNamePtr),I"%s" for status name (DatStatusNamePtr - as shown in status windows), and:"%d" for value of "%d" variable set eg by prior "Q" or "q"
eScriptNameESpecify script name to load if the following line fails with an error7Eg can be used to trap non-existence of certain process
KMACe
f)Attach to process currently in Foreground2Note that "f" and "F" have quite different effects
g gFilename-Goto first process editing the specified filePFilename can be either short or long - any given path or drive will be respected
LPCELooks at DatStatusNamePtr in short name case, else DatUsedPathNamePtr-Catch any error by using a prior "e" command.
hDylName?Have Kmac load and Hook named DYL (best to give full path name)FEg "h\DYL\Register.dyl" where drive will be taken from Kmac's location
KMACT
iImageName&Start given .IMG file or other utility
Eg "iLOC::M:\IMG\KTLPC.IMG"
jm,nIJump the next n steps if there are more or less (if m < 0) than m dialogs@Can be used to omit a certain step if eg two dialogs are showing
LPC & IPC & KMAC#n defaults to 1 and can be omitted;Yif n is zero, jumps back to start of current script (or to top of macro if not in script)e
k$Kill attached process, using p_pkill7Should be used with caution ("t" or "C" are preferable)
l lFilenameILoad specified script file and take commands from there until end of fileBKeeping commands in file like this cuts down basic RAM working set
mn=Move past the next n steps, unconditionally (n defaults to 1)Yif n is zero, moves back to start of current script (or to top of macro if not in script)
KMACQ
n)Wait until nudged before taking next step
Same as "s1" followed by "s0"
o oProgName
Start specified Opl program
Eg "o\OPO\TKMACLIB.OPO"
LPCDThis Opl program may contain more elaborate tests and LPC operations4Follow an "o" command with a "w" for synchronisation
p pProgNameBExecute given Program, using command line stored, and attach to it9Eg "eROM::WORD.APP" to start and attach to Word Processor
qJQuery whether it would be possible to attach to current foreground process6Set "%d" variable to 1 for if possible and 0 otherwise
LPC & KMAC
r%x,valJReturn one level of calling script, absolutely (if no %x) or conditionally7Commonly of use in conjunction with "J" or "j" commands
x can be one of d, p, f, or s>If x is d, return if %d value is val or less (val is a number)KElse, return if relevant name of attached app differs from val (as string):%"p" for process name (DatCommandPtr),2"f" for family ("alias") name (DatProcessNamePtr),D"s" for status name (DatStatusNamePtr - as shown in status windows).&("%d" variable is set eg by prior "Q")
sn1Set Single stepping state to 0 (default), 1, or 2'Useful when testing or debugging macros
KMAC!"s0" switches single stepping off "s1" switches single stepping on:"s2" shows notifier of next step, before any step proceeds~
tNTerminate attached process, with p_pterminate (like "Kill" from System screen)&Should use "C" instead, where possible
u#Use process with PID stored earlierKIe attach back to this process (PID will have been stored earlier with "v")
v3Store PID of current attached process for use later;Typically will follow "v" in due course with a matching "u"
wIWait until completion of last image (utility) launched, before proceeding(Can be used for synchronisation purposes
x%x,val<EXit playback system, absolutely (if no %x) or conditionallyCCan be used within "called" script files to exit top-level playback
x can be one of d, p, f, or s<If x is d, exit if %d value is val or less (val is a number)IElse, exit if relevant name of attached app differs from val (as string):%"p" for process name (DatCommandPtr),2"f" for family ("alias") name (DatProcessNamePtr),D"s" for status name (DatStatusNamePtr - as shown in status windows).1("%d" variable is set by prior "Q" or "R" dialog)z
y@Yield CPU until all background and foreground processes are idle0Can be used for certain kinds of synchronisation