home *** CD-ROM | disk | FTP | other *** search
/ Amiga Magazin: Amiga-CD 2000 April & May / AMIGA_2000_04.iso / patches / openpicture / ie-openpicture.lha..lha / arexx / OpenPicture.rexx
Encoding:
OS/2 REXX Batch file  |  1999-10-12  |  1.3 KB  |  75 lines

  1. /*
  2.  
  3.    v1.00 Open Picture (for Image Engineer)
  4.  
  5.    Marko Seppänen
  6.    marko.seppanen@wwnet.fi
  7.  
  8. */
  9.  
  10.  
  11. if arg()=0 then exit
  12.  
  13.  
  14.  
  15. /* DO WE HAVE IMAGE ENGINEER AVAILABLE?" */
  16.  
  17. if ~show('P',IMAGEENGINEER) then do
  18.  
  19.   if exists('IE:IE') then do
  20.  
  21.     address command 'Run >NIL: IE:IE'
  22.     do 30 while ~SHOW('P',IMAGEENGINEER)
  23.       address command 'wait >nil: 1'
  24.     end
  25.  
  26.     if ~show('P',IMAGEENGINEER) then do
  27.       say "Could not open Image Engineer's Arexx-port for some reason."
  28.       say "Exiting.."
  29.     end
  30.  
  31.   end
  32.   else do
  33.     say "But where's the Image Engineer?!"
  34.     say "Exiting.."
  35.     exit
  36.   end
  37.  
  38. end
  39.  
  40.  
  41. address IMAGEENGINEER
  42.  
  43. Options results
  44. signal on error
  45.  
  46.  
  47. x=arg(1)
  48. parse var x pic
  49. pic=strip(pic,'B','"')
  50.  
  51.  
  52. OPEN "'"pic"'" COLOUR
  53.  
  54. exit
  55.  
  56.  
  57.  
  58. /*******************************************************************/
  59. /* This is where control goes when an error code is returned by IE */
  60. /* It puts up a message saying what happened and on which line     */
  61. /*******************************************************************/
  62. error:
  63. if RC=5 then do            /* Did the user just cancel us? */
  64.     IE_TO_FRONT
  65.     LAST_ERROR
  66.     'REQUEST "'||RESULT||'"'
  67.     exit
  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.     exit
  74. end
  75.