home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD1.iso / GFX / ADPro251-3.DMS / ADPro251-3.adf / FREDScripts.lha / FREDSavers / SaveToPREFPRINTER.fred < prev   
Encoding:
Text File  |  1994-01-31  |  5.1 KB  |  212 lines

  1. /*
  2. ** SaveToPREFPRINTER.fred
  3. **
  4. ** $VER: SaveToPREFPRINTER.fred 1.2.0 (24.10.93)
  5. **
  6. ** This program can be run from an InvokeADPro list to save images to
  7. ** the currently selected Preferences supported printer.  Including this
  8. ** program automatically causes a pre script to be executed as well (to
  9. ** specify the print settings).
  10. **
  11. ** Clips Imported:
  12. **    FREDPREFPRINTERUseDefaults    -    ~0 to use current settings
  13. **                        0 to specify new settings
  14. **    FREDPREFPRINTEROrientation    -    Orientation of print
  15. **    FREDPREFPRINTERDither        -    Dither method to use
  16. **    FREDPREFPRINTERMaskSize        -    Dither mask size
  17. **    FREDPREFPRINTERDensity        -    Density
  18. **    FREDPREFPRINTERPrintWidth    -    Print Width
  19. **    FREDPREFPRINTERPrintHeight    -    Print Height
  20. **    FREDPREFPRINTERPrintLeft    -    Print Left Offset
  21. **    FREDPREFPRINTERPrintTop        -    Print Top Offset
  22. **    FREDPREFPRINTERPageWidth    -    Page Width
  23. **    FREDPREFPRINTERPageHeight    -    Page Height
  24. **    FREDPREFPRINTERPageLeft        -    Page Left Margin
  25. **    FREDPREFPRINTERPageTop        -    Page Top Margin
  26. **    FREDPREFPRINTERPaperHeight    -    Paper Height
  27. **
  28. ** NOTE: Clip names are case sensitive.
  29. **
  30. ** This script requires FRED v1.4.0 (or higher) to run.  Also required is
  31. ** ADPro v2.5.0 (or higher).
  32. **
  33. ** Copyright © 1992-1993 ASDG, Incorporated
  34. ** All Rights Reserved
  35. */
  36.  
  37.  
  38. ADDRESS "ADPro"
  39. OPTIONS RESULTS
  40.  
  41. PARSE ARG FrameNum FrameFName Length LoadFlag FirstCallSeq FirstCallCell
  42.  
  43. NL = '0A'X
  44. SQ = '27'X
  45. DQ = '22'X
  46. TRUE  = 1
  47. FALSE = 0
  48.  
  49.  
  50. /*
  51. ** Get the required clips.  Error if any are missing.
  52. */
  53.  
  54. UseDefaults = GETCLIP( "FREDPREFPRINTERUseDefaults" )
  55. IF (UseDefaults = 0) THEN DO
  56.     Orientation = GETCLIP( "FREDPREFPRINTEROrientation" )
  57.     IF (Boosted = "") THEN DO
  58.         ADPRO_TO_FRONT
  59.         OKAY1 "Required clip, FREDPREFPRINTEROrientation," || NL ||,
  60.             "is not specified."
  61.         SCREEN_TO_FRONT "FRED"
  62.         EXIT 10
  63.     END
  64.  
  65.     Dither = GETCLIP( "FREDPREFPRINTERDither" )
  66.     IF (Dither = "") THEN DO
  67.         ADPRO_TO_FRONT
  68.         OKAY1 "Required clip, FREDPREFPRINTERDither," || NL ||,
  69.             "is not specified."
  70.         SCREEN_TO_FRONT "FRED"
  71.         EXIT 10
  72.     END
  73.  
  74.     MaskSize = GETCLIP( "FREDPREFPRINTERMaskSize" )
  75.     IF (MaskSize = "") THEN DO
  76.         ADPRO_TO_FRONT
  77.         OKAY1 "Required clip, FREDPREFPRINTERMaskSize," || NL ||,
  78.             "is not specified."
  79.         SCREEN_TO_FRONT "FRED"
  80.         EXIT 10
  81.     END
  82.  
  83.     Density = GETCLIP( "FREDPREFPRINTERDensity" )
  84.     IF (Density = "") THEN DO
  85.         ADPRO_TO_FRONT
  86.         OKAY1 "Required clip, FREDPREFPRINTERDensity," || NL ||,
  87.             "is not specified."
  88.         SCREEN_TO_FRONT "FRED"
  89.         EXIT 10
  90.     END
  91.  
  92.     PrintWidth = GETCLIP( "FREDPREFPRINTERPrintWidth" )
  93.     IF (PrintWidth = "") THEN DO
  94.         ADPRO_TO_FRONT
  95.         OKAY1 "Required clip, FREDPREFPRINTERPrintWidth," || NL ||,
  96.             "is not specified."
  97.         SCREEN_TO_FRONT "FRED"
  98.         EXIT 10
  99.     END
  100.  
  101.     PrintHeight = GETCLIP( "FREDPREFPRINTERPrintHeight" )
  102.     IF (PrintHeight = "") THEN DO
  103.         ADPRO_TO_FRONT
  104.         OKAY1 "Required clip, FREDPREFPRINTERPrintHeight," || NL ||,
  105.             "is not specified."
  106.         SCREEN_TO_FRONT "FRED"
  107.         EXIT 10
  108.     END
  109.  
  110.     PrintLeft = GETCLIP( "FREDPREFPRINTERPrintLeft" )
  111.     IF (PrintLeft = "") THEN DO
  112.         ADPRO_TO_FRONT
  113.         OKAY1 "Required clip, FREDPREFPRINTERPrintLeft," || NL ||,
  114.             "is not specified."
  115.         SCREEN_TO_FRONT "FRED"
  116.         EXIT 10
  117.     END
  118.  
  119.     PrintTop = GETCLIP( "FREDPREFPRINTERPrintTop" )
  120.     IF (PrintTop = "") THEN DO
  121.         ADPRO_TO_FRONT
  122.         OKAY1 "Required clip, FREDPREFPRINTERPrintTop," || NL ||,
  123.             "is not specified."
  124.         SCREEN_TO_FRONT "FRED"
  125.         EXIT 10
  126.     END
  127.  
  128.     PageWidth = GETCLIP( "FREDPREFPRINTERPageWidth" )
  129.     IF (PageWidth = "") THEN DO
  130.         ADPRO_TO_FRONT
  131.         OKAY1 "Required clip, FREDPREFPRINTERPageWidth," || NL ||,
  132.             "is not required."
  133.         SCREEN_TO_FRONT "FRED"
  134.         EXIT 10
  135.     END
  136.  
  137.     PageHeight = GETCLIP( "FREDPREFPRINTERPageHeight" )
  138.     IF (PageHeight = "") THEN DO
  139.         ADPRO_TO_FRONT
  140.         OKAY1 "Required clip, FREDPREFPRINTERPageHeight," || NL ||,
  141.             "is not specified."
  142.         SCREEN_TO_FRONT "FRED"
  143.         EXIT 10
  144.     END
  145.  
  146.     PageLeft = GETCLIP( "FREDPREFPRINTERPageLeft" )
  147.     IF (PageLeft = "") THEN DO
  148.         ADPRO_TO_FRONT
  149.         OKAY1 "Required clip, FREDPREFPRINTERPageLeft," || NL ||,
  150.             "is not specified."
  151.         SCREEN_TO_FRONT "FRED"
  152.         EXIT 10
  153.     END
  154.  
  155.     PageTop = GETCLIP( "FREDPREFPRINTERPageTop" )
  156.     IF (PageTop = "") THEN DO
  157.         ADPRO_TO_FRONT
  158.         OKAY1 "Required clip, FREDPREFPRINTERPageTop", || NL ||,
  159.             "is not specified."
  160.         SCREEN_TO_FRONT "FRED"
  161.         EXIT 10
  162.     END
  163.  
  164.     PaperHeight = GETCLIP( "FREDPREFPRINTERPaperHeight" )
  165.     IF (PaperHeight = "") THEN DO
  166.         ADPRO_TO_FRONT
  167.         OKAY1 "Required clip, FREDPREFPRINTERPaperHeight," || NL ||,
  168.             "is not specified."
  169.         SCREEN_TO_FRONT "FRED"
  170.         EXIT 10
  171.     END
  172. END
  173.  
  174.  
  175. /*
  176. ** See what type of data is loaded in ADPro/MorphPlus.
  177. */
  178.  
  179. CALL "FREDSCRIPTS:FREDFunctions/CheckForRawImageData" TRUE
  180. IF (RESULT ~= 0) THEN
  181.     EXIT 10
  182.  
  183.  
  184. /*
  185. ** Do the printing.
  186. */
  187.  
  188. IF (UseDefaults ~= 0) THEN
  189.     SAVER "PREFPRINTER" "XXX" "RAW"
  190. ELSE DO
  191.     IF (MaskSize = 0) THEN
  192.         SAVER "PREFPRINTER" "XXX" "RAW" Orientation Dither Density ,
  193.             PrintWidth PrintHeight PrintLeft PrintTop ,
  194.             PageWidth PageHeight PageLeft PageTop ,
  195.             PaperHeight
  196.     ELSE
  197.         SAVER "PREFPRINTER" "XXX" "RAW" Orientation Dither MaskSize Density ,
  198.             PrintWidth PrintHeight PrintLeft PrintTop ,
  199.             PageWidth PageHeight PageLeft PageTop ,
  200.             PaperHeight
  201. END
  202.  
  203. IF (RC ~= 0) THEN DO
  204.     Why = ADPRO_RESULT
  205.     ADPRO_TO_FRONT
  206.     OKAY1 "PREFPRINTER save failed:" || NL || Why
  207.     SCREEN_TO_FRONT "FRED"
  208.     EXIT 10
  209. END
  210.  
  211. EXIT 0
  212.