home *** CD-ROM | disk | FTP | other *** search
/ ftp.wwiv.com / ftp.wwiv.com.zip / ftp.wwiv.com / pub / CEREBRUM / ELN321.ZIP / elnmacro.txt < prev    next >
Text File  |  1994-06-25  |  10KB  |  214 lines

  1.                         ELN 3.1 Macro Facility
  2.  
  3. In ELN 3.1, macros can be recorded and played back.  These macros replace
  4. your mouse movements and keystrokes.  One use for them is to have ELN
  5. run automatically when you are not present - run ELN, specifying a macro
  6. on the command line.  The macro will load the files you want to edit,
  7. perform the actions specified, and can exit the program.
  8.  
  9. The unregistered version can record macros but can not play them.
  10.  
  11. Keys:      RECORD    ctrl-alt-F8
  12.            PLAY      ctrl-alt-F7
  13.            STOP      ctrl-break
  14.  
  15. 1.0   Recording Macros Live
  16.  
  17. The easiest way to create an ELN macro is to run ELN, press the 'Record'
  18. keys, and perform the actions you wish to be included in the macro.  Once
  19. you have finished this, you can either press 'Record' again or 'Stop', or exit
  20. ELN - in the latter case, the exiting will be included as part of the macro,
  21. (the last action in the macro will be a pressing of the 'Quit' button), and
  22. it can exit the program when played back.
  23.  
  24. The 'Record' key is Control-Alt-F8.  Press this when you wish to begin
  25. recording (you'll see a small box appear onscreen with the word "Recording",
  26. for about a half-second), and press it again when you are finished (or use
  27. ctrl-break).  After you have finished the recording (either by pressing
  28. 'Stop' or exiting ELN), you'll be asked to specify a filename to save the
  29. macro as.  You can edit this *.MCR file with any text editor.
  30.  
  31. When recording, it's important to remember that ELN simply records the
  32. keys pressed and mouse movements/button status.  Because of this, you
  33. must be sure that everything you do will be very predictable and the
  34. basic events recorded can reproduce a sequence.  For example, you may
  35. normally choose a file by clicking on its name in a list-box.  This should
  36. *not* be done in a macro!  Clicking on the fourth line of a list-box will
  37. load whatever file is fourth in the directory.  The next time you run
  38. the macro, the file you thought was fourth in the directory may not be
  39. in that position - another filename will occupy position #4 in that listbox,
  40. and so the wrong file will be loaded, as the macro only contains instructions
  41. to click the mouse on line 4 of the listbox.
  42.  
  43. Some general hints:
  44.   - avoid choosing items from listboxes.  Something else may be in
  45.     that position when you play back next time.
  46.   - filenames should *always* be specified by typing a path name
  47.     on the first line of the FileOpen dialog box.
  48.   - to invoke the FileOpen dialog box from the network selection
  49.     list box, normally you would choose "<find file>".  However,
  50.     you can't click on it and expect it to be in the same place
  51.     next time.  Solution:  press the 'END'key.  This will always go
  52.     to the last item in the listbox, which is guaranteed to be
  53.     "<find file>" for this particular box.
  54.   - keyboard actions are safer than mouse actions
  55.   - play back macros containing mouse actions at the same screen
  56.     resolution they were recorded ("vga50=yes|no"), so that
  57.     buttons will be in their proper places.
  58.   - if you want to delete multiple tagged items after a search,
  59.     use control-D instead of D or alt-D.  Control-D will delete
  60.     all marked items, but if none are marked, it does nothing.
  61.     (if you use D or alt-D instead, and a search results in no
  62.     items tagged, the currently-selected message will be deleted.
  63.     Typically, this is undesireable.)
  64.   - if the macro is meant to be run unattended, be sure that its
  65.     actions are completely predictable, that there will be no
  66.     unanticipated Yes/No question boxes.  Manually editing the
  67.     file and adding a half-dozen 'KEY 27 0' lines (ESC key) will
  68.     enable the program to exit normally if something unexpected
  69.     happens.
  70.  
  71. 2.0 Macro Playback
  72.  
  73. A macro must be played back from the same location (main menu, viewer,
  74. header editor, etc), in which it was originally recorded.  To load
  75. and playback a previously-recorded macro, press Ctrl-Alt-F7, and
  76. type its filename.
  77.  
  78. Run a macro immediately upon starting ELN by specifying its filename
  79. on the command line, with the -m flag:
  80.  
  81. D:\BBS> eln -mMACRO1.MCR
  82.  
  83. Starting ELN normally puts you at the listbox where you can select a
  84. network.  You can start recording here, and make the file selection
  85. process a part of the macro.  A much more reliable method is to run ELN
  86. with a filename and network number on the command line, record the macro
  87. from the main menu (with the file loaded), and then playback in the same
  88. manner.  That is,
  89.  
  90. D:\BBS> eln DEAD.NET .0        (edit DEAD.NET in network 0)
  91.   <DEAD.NET is opened.  From the main menu, press the Record keys, record
  92.    your macro, exit ELN and save the macro >
  93.  
  94. D:\BBS> eln DEAD.NET .0 -mMYMACRO.MCR
  95.   <when it is run again and you're not there, specifying the filename and
  96.    net on the command line will cause the main menu to be the place where
  97.    the macro starts running>
  98.  
  99. 3.0 Macro File Format
  100.  
  101. An ELN macro file is a plain text file, with one command (followed by its
  102. parameters) per line.  It's typically easiest to create one by pressing
  103. 'Record' (ctrl-alt-F8) from within ELN, save it, and make changes with
  104. any text editor.  A sample:
  105.  
  106. ; This macro must be invoked from the main menu (it was recorded starting
  107. ; at the main menu).  It will load the search specification "8DAYS.ESS",
  108. ; to search for messages older than eight days, run the search, delete
  109. ; all found items, and exit ELN.
  110. ; semicolons indicate comments
  111. ; command     arg1    arg2
  112. MMOVE           40     24
  113. ; for a MMOVE (mouse movements), args are X (0-79) and Y (0-49 or 0-24)
  114. MMOVE           30     21
  115. MMOVE           32     21
  116. MMOVE           33     21
  117. ; -- press the search button ('S' key)  (second parameter for KEY is ignored)
  118. KEY            's'   ''
  119. ; -- search dialog box appears.  Press 'L'oad button
  120. KEY            'l'   ''
  121. ; -- type the filename "8DAYS.ESS" into the FileOpen dialog box
  122. KEY            '8'   ''    ; comments can go at end of command lines
  123. KEY            'd'   ''
  124. KEY            'a'   ''
  125. KEY            'y'   ''
  126. KEY            's'   ''
  127. KEY            '.'   ''
  128. KEY            'e'   ''
  129. KEY            's'   ''
  130. KEY            's'   ''
  131. ; -- press RETURN to indicate you're finished typing the filename.
  132. ;  (user numerical value of RETURN so it isn't interpreted as end-of-line)
  133. KEY             13      0
  134. ; -- another RETURN to close the Search Params box (Return means "OK")
  135. KEY             13      0
  136. ; the search runs, and then we're back at the main menu.
  137. ; -- control-D to delete all marked items (see preceding section for why
  138. ;   control-D must be used instead of the usual 'D' or alt-D)
  139. KEY              4      0
  140. ; -- 'Y'es when asked if you really want to delete all marked items
  141. KEY            'y'   ''
  142. ; -- 'Q'uit, close this packet file
  143. KEY            'q'   ''
  144. ; -- 'Q'uit, exit the program
  145. KEY            'q'   ''
  146.  
  147. 4.0  Commands available
  148.  
  149. Most of the commands simulate a user action (mouse click, keypress).  These
  150. always have two parameters, although the second is often ignored.  Parameters
  151. can be specified either numerically, or as a character within single quotes.
  152.  
  153. KEY    asciival  ignored
  154.  
  155. Generates a keystroke.  The first parameter is the ASCII represenation of
  156. the key, the second param is unused.  "KEY 'a' ' '  ",  "KEY 13 0" (13 is
  157. the RETURN/ENTER key), "KEY 'Q' ' ' ".
  158.  
  159. EXTKEY  keycode ignored
  160.  
  161. Similar to KEY, the EXTKEY command sends a keystroke - in this case,
  162. keys like F1, ALT-Q, INSERT, etc.  The keycode parameter can be found
  163. in some programming books as the second character generated by getch(),
  164. following a zero.  (for example, if F1 is pressed, two calls to getch()
  165. will return zero and 59; the 59 is the value that should be on this line).
  166.  
  167. TAB ignored ignored
  168.  
  169. Send a 'TAB' keystroke.  As this is handled differently than most keypresses,
  170. 'KEY' cannot be used to send a TAB.  TABs are used for moving between
  171. entry fields.
  172.  
  173. MMOVE   x  y
  174.  
  175. A mouse movement, with the parameters being the horizontal coordinate
  176. (0 to 79) and the vertical coordinate (0 to 49 or 0 to 24, depending on
  177. your VGA50 setting).  A file recorded by ELN will typically have many
  178. MMOVE's - it is safe to delete most of them.  MMOVE's are only significant
  179. if something is being dragged, such as a listbox's selection bar.  At all
  180. other times, only mouse button events are important.  (It's recommended that
  181. you delete excess MMOVE's (other than within a dragging operation) from
  182. the file.  The animation of the cursor will not be as smooth, but the macro
  183. will be smaller and faster).
  184.  
  185. MBTNRELEASE  x  y
  186.  
  187. Parameters are the same as for MMOVE, and are *not* optional.  A
  188. MBTNRELEASE occurs when the user releases the mouse buttons, and must
  189. always follow MLCLICK, MRCLICK, etc.  MBTNRELEASE's are important:
  190. buttons are triggered by the release rather than the click.
  191.  
  192. MLCLICK  x  y
  193. MRCLICK  x  y
  194. MLEFTRIGHT  x  y
  195.  
  196. Parameters are as for MBTNRELEASE.  The left button, right button, or
  197. both together (respectively) have been depressed.  Any of these must
  198. always be followed by a MBTNRELEASE.  A "double-click" is defined as a
  199. click, release, click, release, with no events in between, and all with
  200. the same X and Y values.
  201.  
  202. The following commands do not simulate user events:
  203.  
  204. DELAY milliseconds
  205.  
  206. Pause for a number of milliseconds, then continue - useful for slowing
  207. macro playback down for debugging.  (millisecond = 1/1000 sec.)
  208.  
  209. SPEED milliseconds
  210.  
  211. Equivalent to a DELAY after *every* nondelay event.  Place one SPEED
  212. line at the beginning of a section you want to watch closely, and a
  213. SPEED 0 at the end.
  214.