home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format 19 / af019.adf / INSTALLPRINTER < prev    next >
Text File  |  1978-04-04  |  3KB  |  127 lines

  1. . key number
  2. .bra {
  3. .ket }
  4. def number 0
  5.  
  6. ; This recursive script comes courtesy of Mastering AmigaDOS scripts
  7. ; another great volume in the Mastering AmigaDOS series
  8. ; Mastering AmigaDOS scripts will be published in mid 1991
  9. ; by Bruce Smith Books
  10. ; This trinket written by Mark Smiddy"
  11. ; for Amiga Format readers
  12. ; IT MUST HAVE THE NAME OF INSTALLPRINTER
  13.  
  14. if "{number}" EQ "0"
  15.  echo "Easy Printer Driver setup*n"
  16.  echo "Written by *e[33mMark Smiddy*e[31m for *e[33mAmiga Format*e[31m"
  17.  echo "From Mastering AmigaDOS scripts"
  18.  echo "Another volume in the Mastering AmigaDOS 2 series"
  19.  echo "The most informed AmigaDOS reference EVER!*n*n"
  20.  if not exists ram:Smiddy
  21.   echo "Wait - copying commands to resident list...*n*n*n"
  22.   resident c:echo add
  23.   resident c:if add
  24.   resident c:else add
  25.   resident c:endif add
  26.   resident c:copy add
  27.   resident c:delete add
  28.   resident c:join add
  29.   resident c:edit add
  30.   resident c:assign add
  31.   resident c:execute add
  32.   resident c:type add
  33.   resident c:list add
  34.   resident c:ask add
  35.   resident c:search add
  36.   copy installprinter ram:
  37.   echo >ram:Smiddy "Working..."
  38.  endif
  39.  
  40.  if not exists ram:drivers
  41.   echo "*nInsert the disk marked *"Extras 1.3*" in df0:"
  42.   ask "Then press return..."
  43.   echo "copying drivers to ram: please wait..."
  44.   copy df0:devs/printers/#? ram:drivers quiet
  45.  endif
  46.  
  47.  list ram:drivers to ram:print lformat "%s"
  48.  type >ram:printers ram:print opt n
  49.  type ram:printers
  50.  echo "*nSelect your printer and enter its " noline
  51.  execute ram:InstallPrinter ?
  52.  echo "*nInsert the disk marked *"Workbench 1.3*" in df0:"
  53.  ask "Then press return..."
  54.  if exists ram:command1
  55.  execute ram:command1
  56. ;
  57. ; This next bit runs Preferences for you
  58. ; BUT it allows you to modify the preferences on ANY disk!
  59. ; This way you can have more than one printer disk... etc.
  60. ;
  61.  ask "*nRun Preferences now?"
  62.   if warn
  63.    assign devs: df0:devs
  64.    if exists df0:Prefs/Preferences
  65.      df0:Prefs/Preferences PRINTER
  66.    else
  67.     echo "Preferences program missing/renamed"
  68.     ask "Shall I try the boot disk?"
  69.     if warn
  70.      if exists sys:Prefs/Preferences
  71.       sys:Prefs/Preferences PRINTER
  72.      else
  73.      echo "Blow me! That one's missing 'n all guv!"
  74.      endif
  75.     endif
  76.    endif
  77.    assign devs: sys:devs
  78.  endif
  79.  echo "All done... cleaning up"
  80.  endif
  81.  
  82.  if "{number}" NOT EQ ""
  83.   delete ram:smiddy
  84.   resident echo remove
  85.   resident assign remove
  86.   resident if remove
  87.   resident endif remove
  88.   resident copy remove
  89.   resident type remove
  90.   resident execute remove
  91.   resident join remove
  92.   resident edit remove
  93.   resident list remove
  94.   resident ask remove
  95.   resident else remove
  96.   resident search remove
  97.   resident delete remove
  98.  endif
  99. endif
  100. else
  101.  
  102.  
  103. ;
  104. ; Here we use the auto EDIT macros!
  105. ; This is covered with loads of examples in
  106. ; Mastering AmigaDOS volumes I and II
  107. ;
  108.  
  109.  
  110.  search >nil: ram:printers search " {number} "
  111.  if warn
  112.   echo "Can't find that printer on my list..."
  113.   echo "Program exiting"
  114.   endcli
  115.  else
  116.   echo >ram:auto1 "df / {number} /;7#;n;0d"
  117.   echo >ram:auto2 "cl//"
  118.   echo >ram:part1 "COPY from ram:drivers/" noline
  119.   echo >ram:part3 " to df0:devs/printers" noline
  120.   edit from ram:printers to ram:part2 with ram:auto1 ver=nil:
  121.   join ram:part1 ram:part2 rampart3 as ram:command
  122.   edit ram:command to ram:command1 with ram:auto2 ver=nil:
  123.   echo "*n Your selection was: " noline
  124.   type ram:part2
  125.  endif
  126. endif
  127.