home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD1.iso / GFX / Converter / BK-ADPR1.DMS / in.adf / InstallData / AppScripts.lzx / AppScripts / DisplayImage.adproapp
Encoding:
Text File  |  1996-03-20  |  1.5 KB  |  91 lines

  1. /*
  2. ** DisplayImage.adproapp
  3. **
  4. ** $VER: DisplayImage.adproapp 1.0.1 (22.2.94)
  5. **
  6. ** This ARexx script for ADPro is intended to be used as the script that
  7. ** gets executed when one or more files is dropped on the ADPro AppWindow
  8. ** or AppIcon.  As such, you should set the APPSCRIPT tool type or
  9. ** CLI argument to this script's filename.
  10. **
  11. ** This app script allows you to load and display the first image dropped
  12. ** on the AppWindow/AppIcon/AppMenu.  If more than one image is dropped,
  13. ** they will be ignored.
  14. **
  15. ** This script requires ADPro v2.5.0 (or higher).
  16. **
  17. ** Copyright © 1993-1994 ASDG, Incorporated
  18. ** All Rights Reserved
  19. */
  20.  
  21.  
  22. ADDRESS "ADPro"
  23. OPTIONS RESULTS
  24.  
  25. PARSE ARG Filenames
  26.  
  27. NL = '0A'X
  28. SQ = '27'X
  29. DQ = '22'X
  30. TRUE  = 1
  31. FALSE = 0
  32. TempDefaults = "T:TempADProDefaults"
  33.  
  34.  
  35. /*
  36. ** Save the current environment.
  37. */
  38.  
  39. SAVE_DEFAULTS TempDefaults
  40.  
  41.  
  42. /*
  43. ** Build list of images, just in case we need to loop.
  44. */
  45.  
  46. NumFiles = WORDS( Filenames )
  47. DO i=1 TO NumFiles
  48.     FrameFName.i = WORD( Filenames, i )
  49. END
  50.  
  51.  
  52. /*
  53. ** Load only the first image.
  54. */
  55.  
  56. LOADER "UNIVERSAL" FrameFName.1
  57. IF (RC ~= 0) THEN DO
  58.     ADPRO_TO_FRONT
  59.     OKAY1 "Error loading file:" || NL ||,
  60.         FrameFName.1
  61.     CALL ErrorOut 10
  62. END
  63.  
  64.  
  65. /*
  66. ** Render the image to the current render screen.
  67. */
  68.  
  69. EXECUTE
  70.  
  71. ADPRO_DISPLAY
  72.  
  73.  
  74. CALL ErrorOut 0
  75.  
  76.  
  77. ErrorOut:
  78.     PARSE ARG ExitCode
  79.  
  80.     IF (EXISTS( TempDefaults )) THEN DO
  81.         LOAD_DEFAULTS TempDefaults
  82.         IF (RC ~= 0) THEN DO
  83.             ADPRO_TO_FRONT
  84.             OKAY1 "Error restoring settings."
  85.         END
  86.  
  87.         ADDRESS COMMAND "Delete >NIL:" TempDefaults
  88.     END
  89.  
  90.     EXIT ExitCode
  91.