home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #4 / Amiga Plus CD - 2000 - No. 4.iso / Tools / Grafik / Misc / ImageEnginer / ARexx / Batch / Check.ieb < prev    next >
Encoding:
Text File  |  1997-02-02  |  1.9 KB  |  76 lines

  1. /*
  2. ** $VER: Check.ieb 1.0, IE Arexx script
  3. ** Image Engineer Batch Processing script
  4. ** Copyright © by Patrik M Nydensten 
  5. ** 21/1 1997 Stockholm/Sweden
  6. **
  7. ** Do nothing.
  8. */
  9.  
  10. options results
  11. signal on error
  12.  
  13. parse arg input command
  14. input = upper(strip(input))
  15. address 'IMAGEENGINEER'
  16.  
  17. select  /* Required batch script commands */
  18.   when input = 'INFO' then    return get_info()
  19.   when input = 'CONFIG' then  return get_config(command)
  20.   when input = 'PROCESS' then return process_image(command)
  21.   otherwise do
  22.     'REQUEST' '"Failure in call to batch script!"' '" Quit "'
  23.     return '<ERROR>'
  24.   end
  25. end
  26.  
  27. exit 0
  28.  
  29. /* Required "Get_info" procedure  ------------------------------------ */
  30. /* S = SECONDARY, A = ALPHA, 1 = Single file, 2 = Multiple files       */
  31.  
  32. get_info:
  33.   back = 'OK'
  34. return back
  35.  
  36. /* Required "Get_config" procedure  ---------------------------------- */
  37.  
  38. get_config:
  39.   parse arg '"'command'"'
  40.   
  41.   back = '#OK'
  42. return back
  43.  
  44. /* Required "Process_image" procedure  ------------------------------- */
  45.  
  46. process_image:
  47.   parse arg '"'src_image'"' '"'dst_image'"' '"'options'"'
  48.   parse var options Gamma '#'CalcType
  49.  
  50.   if ~exists(src_image) then do
  51.     'REQUEST' '"Can not load `'src_image'` !"' '" OK "'
  52.   end
  53.  
  54.   back = 'OK'
  55. return back
  56.  
  57. /* Internal procedures  ---------------------------------------------- */
  58.  
  59. /*******************************************************************/
  60. /* This is where control goes when an error code is returned by IE */
  61. /* It puts up a message saying what happened and on which line     */
  62. /*******************************************************************/
  63. error:
  64. if RC=5 then do            /* Did the user just cancel us? */
  65.     IE_TO_FRONT
  66.     LAST_ERROR
  67.     'REQUEST "'||RESULT||'"'
  68. end
  69. else do
  70.     IE_TO_FRONT
  71.     LAST_ERROR
  72.     'REQUEST "Error detected!!!'||D2C(10)||'Image Engineer error message is as follows'||D2C(10)||result||D2C(10)||'Script failed on line '||SIGL||'"' 'Doh!'
  73. end
  74.  
  75. return '<ERROR>'
  76.