home *** CD-ROM | disk | FTP | other *** search
Wrap
/* Image Engineer ARexx macro script */ /* by Simon Edwards */ /* 1/4/96 */ /* AddNewIcon V1.0 (same as MakeIcon except */ /* uses NewIcon.palette. */ /* */ Options results signal on error /* Setup a place for errors to go */ 'GET_FILES "Choose Images to add icons to" "Add Icons" "sys:"' MyFileList=RESULT /* Keep going till we run out of files */ do while MyFileList~="" /* Get the next file name */ parse var MyFileList MyFile ';' MyFileList CALL AddIcon end exit AddIcon: 'OPEN "'||MyFile||'" COLOUR' InputProject=RESULT PROJECT_INFO InputProject WIDTH ImageWidth=RESULT PROJECT_INFO InputProject HEIGHT ImageHeight=RESULT if ImageWidth/ImageHeight>(36.0/40.0) then do NewWidth=36 NewHeight=ImageHeight*36.0/ImageWidth end else do NewWidth=ImageWidth*40.0/ImageHeight NewHeight=40 end SCALE InputProject NewWidth NewHeight BEST icon=RESULT 'PALETTE_LOAD' icon '"IE:palettes/newicon.palette"' RENDER_DEPTH icon 16 RENDER_COLOURS icon 16 RENDER_DEVICE icon AMIGA RENDER_DITHER icon NONE RENDER_PALETTE icon LOCK RENDER icon SAVE_CLIP icon CLOSE icon address COMMAND 'copy env:sys/def_picture.info "'||MyFile||'.info"' address COMMAND 'injectbrush "'||MyFile||'.info" CLIPS:0 CLIPS:0 FORCE' CLOSE InputProject return /*******************************************************************/ /* This is where control goes when an error code is returned by IE */ /* It puts up a message saying what happened and on which line */ /*******************************************************************/ error: if RC=5 then do /* Did the user just cancel us? */ IE_TO_FRONT LAST_ERROR 'REQUEST "'||RESULT||'"' exit end else do IE_TO_FRONT LAST_ERROR 'REQUEST "Error detected!!!'||D2C(10)||'Image Engineer error message is as follows'||D2C(10)||result||D2C(10)||'Script failed on line '||SIGL||'"' 'Doh!' exit end