home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD1.iso / GFX / ADPro251-3.DMS / ADPro251-3.adf / SaversPseudo.lha / _MultiCopyPREFPRINTER next >
Encoding:
Text File  |  1994-01-31  |  2.0 KB  |  113 lines

  1. /*
  2. ** _MultiCopyPREFPRINTER
  3. **
  4. ** $VER: _MultiCopyPREFPRINTER 1.0.0 (22.11.93)
  5. **
  6. ** This program can be run from ADPro's savers list to print out the current raw
  7. ** image data to the printer using the current PREFPRINTER settings.  Multiple
  8. ** copies can be printed, and there is an option to have it print unattended or
  9. ** ask you after each print whether to continue with the next print.
  10. **
  11. ** This script required ADPro v2.5.0 (or higher).
  12. **
  13. ** Copyright © 1993 ASDG, Incorporated
  14. ** All Rights Reserved
  15. */
  16.  
  17.  
  18. ADDRESS "ADPro"
  19. OPTIONS RESULTS
  20.  
  21. NL = '0A'X
  22. SQ = '27'X
  23. DQ = '22'X
  24. TRUE  = 1
  25. FALSE = 0
  26. TempDefaults = "T:TempADProDefaults"
  27.  
  28.  
  29. /*
  30. ** Save the current environment.
  31. */
  32.  
  33. SAVE_DEFAULTS TempDefaults
  34.  
  35.  
  36. /*
  37. ** See what type of data is loaded in ADPro/MorphPlus.
  38. */
  39.  
  40. CALL "FREDSCRIPTS:FREDFunctions/CheckForRawImageData" TRUE
  41. IF (RESULT ~= 0) THEN
  42.     CALL ErrorOut 10
  43.  
  44.  
  45. /*
  46. ** Ask how many copies to print.
  47. */
  48.  
  49. CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Enter number of copies."' 1 1 100 TRUE
  50. IF (RESULT = (1-1)) THEN
  51.     CALL ErrorOut 10
  52. NumCopies = RESULT
  53.  
  54.  
  55. /*
  56. ** Ask if the next print should be confirmed.
  57. */
  58.  
  59. IF (NumCopies > 1) THEN DO
  60.     ADPRO_TO_FRONT
  61.  
  62.     OKAYN '"_MultiCopyPREFPRINTER"' '"Print continuously?"' '"Print Unattended|Query Before Printing|Cancel"'
  63.     IF (RC = 0) THEN
  64.         CALL ErrorOut 10
  65.     ELSE
  66.         Continuous = 2 - RC
  67. END
  68.  
  69.  
  70. /*
  71. ** Print it.
  72. */
  73.  
  74. CurrCopy = 1
  75. DO WHILE (CurrCopy <= NumCopies)
  76.     IF (Continuous = FALSE) THEN DO
  77.         ADPRO_TO_FRONT
  78.  
  79.         text = "Print copy #" || CurrCopy || "?"
  80.  
  81.         OKAYN '"_MultiCopyPREFPRINTER"' '"'text'"' '"Print|Cancel"'
  82.         IF (RC = 0) THEN
  83.             CALL ErrorOut 10
  84.     END
  85.  
  86.     SAVER "PREFPRINTER" "XXX" "RAW"
  87.     IF (RC ~= 0) THEN DO
  88.         ADPRO_TO_FRONT
  89.         OKAY1 "Could not print copy #" || CurrCopy
  90.         CALL ErrorOut 10
  91.     END
  92.  
  93.     CurrCopy = CurrCopy + 1
  94. END
  95.  
  96. CALL ErrorOut 0
  97.  
  98.  
  99. ErrorOut:
  100.     PARSE ARG ExitCode
  101.  
  102.     IF (EXISTS( TempDefaults )) THEN DO
  103.         LOAD_DEFAULTS TempDefaults
  104.         IF (RC ~= 0) THEN DO
  105.             ADPRO_TO_FRONT
  106.             OKAY1 "Error restoring settings."
  107.         END
  108.  
  109.         ADDRESS COMMAND "Delete >NIL:" TempDefaults
  110.     END
  111.  
  112.     EXIT ExitCode
  113.