home *** CD-ROM | disk | FTP | other *** search
- /*
- ** SaveToPREFPRINTER.fred
- **
- ** $VER: SaveToPREFPRINTER.fred 1.2.0 (24.10.93)
- **
- ** This program can be run from an InvokeADPro list to save images to
- ** the currently selected Preferences supported printer. Including this
- ** program automatically causes a pre script to be executed as well (to
- ** specify the print settings).
- **
- ** Clips Imported:
- ** FREDPREFPRINTERUseDefaults - ~0 to use current settings
- ** 0 to specify new settings
- ** FREDPREFPRINTEROrientation - Orientation of print
- ** FREDPREFPRINTERDither - Dither method to use
- ** FREDPREFPRINTERMaskSize - Dither mask size
- ** FREDPREFPRINTERDensity - Density
- ** FREDPREFPRINTERPrintWidth - Print Width
- ** FREDPREFPRINTERPrintHeight - Print Height
- ** FREDPREFPRINTERPrintLeft - Print Left Offset
- ** FREDPREFPRINTERPrintTop - Print Top Offset
- ** FREDPREFPRINTERPageWidth - Page Width
- ** FREDPREFPRINTERPageHeight - Page Height
- ** FREDPREFPRINTERPageLeft - Page Left Margin
- ** FREDPREFPRINTERPageTop - Page Top Margin
- ** FREDPREFPRINTERPaperHeight - Paper Height
- **
- ** NOTE: Clip names are case sensitive.
- **
- ** This script requires FRED v1.4.0 (or higher) to run. Also required is
- ** ADPro v2.5.0 (or higher).
- **
- ** Copyright © 1992-1993 ASDG, Incorporated
- ** All Rights Reserved
- */
-
-
- ADDRESS "ADPro"
- OPTIONS RESULTS
-
- PARSE ARG FrameNum FrameFName Length LoadFlag FirstCallSeq FirstCallCell
-
- NL = '0A'X
- SQ = '27'X
- DQ = '22'X
- TRUE = 1
- FALSE = 0
-
-
- /*
- ** Get the required clips. Error if any are missing.
- */
-
- UseDefaults = GETCLIP( "FREDPREFPRINTERUseDefaults" )
- IF (UseDefaults = 0) THEN DO
- Orientation = GETCLIP( "FREDPREFPRINTEROrientation" )
- IF (Boosted = "") THEN DO
- ADPRO_TO_FRONT
- OKAY1 "Required clip, FREDPREFPRINTEROrientation," || NL ||,
- "is not specified."
- SCREEN_TO_FRONT "FRED"
- EXIT 10
- END
-
- Dither = GETCLIP( "FREDPREFPRINTERDither" )
- IF (Dither = "") THEN DO
- ADPRO_TO_FRONT
- OKAY1 "Required clip, FREDPREFPRINTERDither," || NL ||,
- "is not specified."
- SCREEN_TO_FRONT "FRED"
- EXIT 10
- END
-
- MaskSize = GETCLIP( "FREDPREFPRINTERMaskSize" )
- IF (MaskSize = "") THEN DO
- ADPRO_TO_FRONT
- OKAY1 "Required clip, FREDPREFPRINTERMaskSize," || NL ||,
- "is not specified."
- SCREEN_TO_FRONT "FRED"
- EXIT 10
- END
-
- Density = GETCLIP( "FREDPREFPRINTERDensity" )
- IF (Density = "") THEN DO
- ADPRO_TO_FRONT
- OKAY1 "Required clip, FREDPREFPRINTERDensity," || NL ||,
- "is not specified."
- SCREEN_TO_FRONT "FRED"
- EXIT 10
- END
-
- PrintWidth = GETCLIP( "FREDPREFPRINTERPrintWidth" )
- IF (PrintWidth = "") THEN DO
- ADPRO_TO_FRONT
- OKAY1 "Required clip, FREDPREFPRINTERPrintWidth," || NL ||,
- "is not specified."
- SCREEN_TO_FRONT "FRED"
- EXIT 10
- END
-
- PrintHeight = GETCLIP( "FREDPREFPRINTERPrintHeight" )
- IF (PrintHeight = "") THEN DO
- ADPRO_TO_FRONT
- OKAY1 "Required clip, FREDPREFPRINTERPrintHeight," || NL ||,
- "is not specified."
- SCREEN_TO_FRONT "FRED"
- EXIT 10
- END
-
- PrintLeft = GETCLIP( "FREDPREFPRINTERPrintLeft" )
- IF (PrintLeft = "") THEN DO
- ADPRO_TO_FRONT
- OKAY1 "Required clip, FREDPREFPRINTERPrintLeft," || NL ||,
- "is not specified."
- SCREEN_TO_FRONT "FRED"
- EXIT 10
- END
-
- PrintTop = GETCLIP( "FREDPREFPRINTERPrintTop" )
- IF (PrintTop = "") THEN DO
- ADPRO_TO_FRONT
- OKAY1 "Required clip, FREDPREFPRINTERPrintTop," || NL ||,
- "is not specified."
- SCREEN_TO_FRONT "FRED"
- EXIT 10
- END
-
- PageWidth = GETCLIP( "FREDPREFPRINTERPageWidth" )
- IF (PageWidth = "") THEN DO
- ADPRO_TO_FRONT
- OKAY1 "Required clip, FREDPREFPRINTERPageWidth," || NL ||,
- "is not required."
- SCREEN_TO_FRONT "FRED"
- EXIT 10
- END
-
- PageHeight = GETCLIP( "FREDPREFPRINTERPageHeight" )
- IF (PageHeight = "") THEN DO
- ADPRO_TO_FRONT
- OKAY1 "Required clip, FREDPREFPRINTERPageHeight," || NL ||,
- "is not specified."
- SCREEN_TO_FRONT "FRED"
- EXIT 10
- END
-
- PageLeft = GETCLIP( "FREDPREFPRINTERPageLeft" )
- IF (PageLeft = "") THEN DO
- ADPRO_TO_FRONT
- OKAY1 "Required clip, FREDPREFPRINTERPageLeft," || NL ||,
- "is not specified."
- SCREEN_TO_FRONT "FRED"
- EXIT 10
- END
-
- PageTop = GETCLIP( "FREDPREFPRINTERPageTop" )
- IF (PageTop = "") THEN DO
- ADPRO_TO_FRONT
- OKAY1 "Required clip, FREDPREFPRINTERPageTop", || NL ||,
- "is not specified."
- SCREEN_TO_FRONT "FRED"
- EXIT 10
- END
-
- PaperHeight = GETCLIP( "FREDPREFPRINTERPaperHeight" )
- IF (PaperHeight = "") THEN DO
- ADPRO_TO_FRONT
- OKAY1 "Required clip, FREDPREFPRINTERPaperHeight," || NL ||,
- "is not specified."
- SCREEN_TO_FRONT "FRED"
- EXIT 10
- END
- END
-
-
- /*
- ** See what type of data is loaded in ADPro/MorphPlus.
- */
-
- CALL "FREDSCRIPTS:FREDFunctions/CheckForRawImageData" TRUE
- IF (RESULT ~= 0) THEN
- EXIT 10
-
-
- /*
- ** Do the printing.
- */
-
- IF (UseDefaults ~= 0) THEN
- SAVER "PREFPRINTER" "XXX" "RAW"
- ELSE DO
- IF (MaskSize = 0) THEN
- SAVER "PREFPRINTER" "XXX" "RAW" Orientation Dither Density ,
- PrintWidth PrintHeight PrintLeft PrintTop ,
- PageWidth PageHeight PageLeft PageTop ,
- PaperHeight
- ELSE
- SAVER "PREFPRINTER" "XXX" "RAW" Orientation Dither MaskSize Density ,
- PrintWidth PrintHeight PrintLeft PrintTop ,
- PageWidth PageHeight PageLeft PageTop ,
- PaperHeight
- END
-
- IF (RC ~= 0) THEN DO
- Why = ADPRO_RESULT
- ADPRO_TO_FRONT
- OKAY1 "PREFPRINTER save failed:" || NL || Why
- SCREEN_TO_FRONT "FRED"
- EXIT 10
- END
-
- EXIT 0
-