home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 3 / Amiga Tools 3.iso / rexx / fitselectalpha.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1995-04-11  |  1.6 KB  |  61 lines

  1. /*********************************/
  2. /* Image Engineer Macro script   */
  3. /* by Simon Edwards              */
  4. /* 3/4/95                        */
  5. /*                               */
  6. /* This lets you select an alpha */ 
  7. /* channel image to be scaled to */
  8. /* the same as the project.      */
  9. /*********************************/
  10.  
  11. Options results
  12. signal on error            /* Setup a place for errors to go */
  13.  
  14. if arg()==0 then exit
  15.  
  16. project_info arg(1) WIDTH
  17. width=RESULT
  18. project_info arg(1) HEIGHT
  19. height=RESULT
  20.  
  21. 'REQUEST "Image to use for alpha channel" "Spherical|Spherical2|Gradient|Highlight|Highlight2"'
  22. reply=RESULT
  23.  
  24. select
  25.     when reply=1 then alphaname='IE:alpha/Spherical.alpha'
  26.     when reply=2 then alphaname='IE:alpha/Spherical2.alpha'
  27.     when reply=3 then alphaname='IE:alpha/Gradient.alpha'
  28.     when reply=4 then alphaname='IE:alpha/highlight.alpha'
  29.     when reply=0 then alphaname='IE:alpha/highlight2.alpha'
  30. end
  31.  
  32. TYPE 8BIT
  33. 'OPEN "'||alphaname||'"'
  34. alphachannel=result
  35. SCALE alphachannel width height BEST
  36. newalpha=result
  37. CLOSE alphachannel
  38.  
  39. MARK arg(1) PRIMARY
  40. MARK newalpha ALPHA
  41.  
  42. exit
  43.  
  44. /*******************************************************************/
  45. /* This is where control goes when an error code is returned by IE */
  46. /* It puts up a message saying what happened and on which line     */
  47. /*******************************************************************/
  48. error:
  49. if RC=5 then do            /* Did the user just cancel us? */
  50.     IE_TO_FRONT
  51.     LAST_ERROR
  52.     'REQUEST "'||RESULT||'"'
  53.     exit
  54. end
  55. else do
  56.     IE_TO_FRONT
  57.     LAST_ERROR
  58.     'REQUEST "Error detected!!!'||D2C(10)||'Image Engineer error message is as follows'||D2C(10)||result||D2C(10)||'Script failed on line '||SIGL||'"' 'Doh!'
  59.     exit
  60. end
  61.