home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 24 / CD_ASCQ_24_0995.iso / dos / tools / aurora21 / maclist.aml < prev    next >
Text File  |  1995-08-10  |  4KB  |  105 lines

  1. /* ------------------------------------------------------------------ */
  2. /* Macro:        MACLIST.AML                                          */
  3. /* Written by:   nuText Systems                                       */
  4. /*                                                                    */
  5. /* Description:  This macro displays a scrollable list of macros,     */
  6. /*               showing the macro name and description for each      */
  7. /*               macro in the list. Selecting a macro from the list   */
  8. /*               will run the macro.                                  */
  9. /*                                                                    */
  10. /* Usage:        Select the 'Macro List' item from the Macro menu,    */
  11. /*               or press <ctrl f12>.                                 */
  12. /* ------------------------------------------------------------------ */
  13.  
  14.   // compile time macros and function definitions
  15.   include  bootpath "define.aml"
  16.  
  17.   // macro list buffer id
  18.   buffer = "maclist"
  19.  
  20.   // create a macro list buffer
  21.   // (modify this list to suit your own preferences)
  22.   databuf buffer
  23.     " ASCII2     2-Dimensional ASCII chart"
  24.     " BOOKLIST   List all bookmarks"
  25.     " CALCPAD    Calculator"
  26.     " CALEN4     Four-month calendar"
  27.     " CALENDAR   One-month calendar"
  28.     " CLRCHART   Color chart"
  29.     " COMPARE    Compare two files"
  30.     " COMPRESS   Display occurrences of a search string by folding lines"
  31.     " COUNTCHR   Count the characters in a file or block"
  32.     " COUNTLIN   Count the lines in multiple files"
  33.     " COUNTWRD   Count the words in a file or block"
  34.     " DELBLANK   Delete blank Lines in a file or block"
  35.     " DELDUP     Delete duplicate lines in a file"
  36.     " DESKOPEN   Open and restore a previously saved desktop layout"
  37.     " DESKSAVE   Save the current desktop layout to a file"
  38.     " DLGDEMO    AML dialog box demo with dialog box controls"
  39.     " DRAWBOX    Draw a box around a column mark"
  40.     " FULLDATE   Display the current date and time in full-format"
  41.     " INSTALL    Run Installation"
  42.     " KEYCODES   Display various keycodes for any key pressed"
  43.     " KEYDEF     Display the assigned state of each assignable key"
  44.     " LONGLINE   Go to the longest line in the current file"
  45.     " PALETTE    Change the color palette"
  46.     " SCRSAVER   Screen Saver Install or Remove"
  47.     " STYLE      Change the editor keyboard/menu style"
  48.     " SUMBLOCK   Add up numbers in a marked block"
  49.     " TABS       Detab a file or block"
  50.     " TABS e     Entab a file or block"
  51.     " TEMPLATE   Template Editing Install or Remove"
  52.     " WHERE      Where-is utility: locate files on any disk drive"
  53.   end
  54.  
  55.   // name the buffer so the menu position will be remembered
  56.   setbufname "mlist"
  57.  
  58.   // display the popup menu
  59.   line = popup buffer "Macro    Description"  getvidcols - 11 getvidrows - 8
  60.  
  61.   // destroy the menu
  62.   destroybuf buffer
  63.  
  64.   // run the selected macro
  65.   if line then
  66.     macro = line [1 : posnot ' ' line [1 : 11] 'r']
  67.  
  68.     // separate file and parameter (if any)
  69.     var parameter
  70.     splitstr ' ' macro ref macro ref parameter
  71.  
  72.     case macro
  73.  
  74.       // desktop functions are not implemented as external macros
  75.       when "DESKOPEN"
  76.         file = ask "Restore desktop from file" "_load"
  77.         if file then
  78.           if opendesk (qualify file (getbufname)) then
  79.             restoredesk
  80.           else
  81.             msgbox "Can't open " + file
  82.           end
  83.         end
  84.  
  85.       when "DESKSAVE"
  86.         file = ask "Save current desktop to file" "_load"
  87.         if file then
  88.           currdesk
  89.           if savedesk (qualify file (getbufname)) then
  90.             display
  91.           else
  92.             msgbox "Can't save " + file
  93.           end
  94.         end
  95.  
  96.       // queue for execution to minimize interpreter stack usage
  97.       when "INSTALL"
  98.         queue "runmacro" (bootpath  macro + ".X")
  99.  
  100.       otherwise
  101.         queue "runmacro" getbootpath + "MACRO\\" + macro + ".X"  parameter
  102.     end
  103.  
  104.   end
  105.