home *** CD-ROM | disk | FTP | other *** search
- /*
- $VER: ThemeConv 0.4 (22.10.98)
- Brute force Windows theme converter
-
- From DOpus:
-
- ARexx ThemeConv.rexx {Ql} {Qd}
-
- From shell:
-
- rx ThemeConv.rexx RAM: HD0:
-
-
- This script will convert the following files from a normal Windows theme
- archive:
-
- #?.wav -> #?.8svx Sound files from WAV to 8SVX
- #?.ico -> #?.info Icon files (NewIcons)
- #?.ani -> #?.anim Animation files from AVI to ANIM5
-
- NOTE: Requires rexxtricks.library and an icon in T: called 'dummy.info'
-
- */
-
- options results
- parse arg shandle dhandle .
- address 'DOPUS.1'
-
- if ~datatype(shandle,'n') & ~datatype(dhandle,'n') then do
- inpath = shandle
- outpath = dhandle
- end
- else do
- if shandle = '' | dhandle = '' then do
- dopus request '"No SOURCE or DESTINATION lister given!" Duh!'
- exit
- end
-
- lister query shandle path
- inpath = result
- lister query dhandle path
- outpath = result
- end
-
- if index(inpath,":") = 0 then inpath = inpath":"
- else if (right(inpath,1) ~= "/") & (right(inpath,1) ~= ":") then inpath = inpath"/"
-
- if index(outpath,":") = 0 then outpath = outpath":"
- else if (right(outpath,1) ~= "/") & (right(outpath,1) ~= ":") then outpath = outpath"/"
-
- if ~exists(inpath) | ~exists(outpath) then do
- dopus request '"One of the supplied paths does not exist!" OK'
- exit
- end
-
- if ~show('l','rexxtricks.library') then
- if ~addlib('rexxtricks.library',0,-30) then exit
-
- call getdir(inpath,'#?.ico','icons','f','p')
- call getdir(inpath,'#?.ani','anims','f','p')
- call getdir(inpath,'#?.wav','waves','f','p')
- if icons.0 ~= 0 then call qsort('icons')
- if anims.0 ~= 0 then call qsort('anims')
- if waves.0 ~= 0 then call qsort('waves')
-
- address command 'Copy dummy.info T:'
- call pragma('d','T:')
-
- if icons.0 ~= 0 then call Icons
- if anims.0 ~= 0 then call Animations
- if waves.0 ~= 0 then call Waves
-
- address command 'Delete T:~(dopus|Command|dummy.inf)#? ALL FORCE QUIET'
- exit
-
- Icons:
- do i = 1 to icons.0
- address command 'cur2ilbm "'icons.i'"'
- pattern = substr(left(icons.i,lastpos('.',icons.i) - 1),pos(':',icons.i) + 1)||'#?.ilbm'
- call getdir('T:',pattern,'itemp','f','n')
- if itemp.0 ~= 0 then do
- call qsort('itemp')
- outname = outpath||substr(translate(left(icons.i,lastpos('.',icons.i)),'_',' '),pos(':',icons.i) + 1)||'info'
- address command 'Copy >NIL: T:dummy.info 'outname
- cmd = 'InjectBrush 'outname' "'itemp.1'" "'itemp.2'" FORCE'
- address command cmd
- if rc ~= 0 then address command 'InjectBrush 'outname' "'itemp.1'" "'itemp.1'" FORCE'
- do j = 1 to itemp.0
- call delete('"'itemp.j'"')
- end
- end
- end
- return
-
- Animations:
- do i = 1 to anims.0
- address command 'cur2ilbm "'anims.i'"'
- pattern = substr(left(anims.i,lastpos('.',anims.i) - 1),pos(':',anims.i) + 1)||'.ilbm.???'
- call getdir('T:',pattern,'atemp','f','n')
- if atemp.0 ~= 0 then do
- call qsort('atemp')
- call open('tempfile','T:animlist','w')
- do j = 1 to atemp.0
- call writeln('tempfile','8 'atemp.j)
- end
- call close('tempfile')
- outname = outpath||substr(translate(left(anims.i,lastpos('.',anims.i)),'_',' '),pos(':',anims.i) + 1)||'anim'
- call delete(outname)
- address command 'MkAnim USING T:animlist TO "'outname'"'
- call delete('T:animlist')
- end
- end
- return
-
- Waves:
- do i = 1 to waves.0
- outname = outpath||substr(translate(left(waves.i,lastpos('.',waves.i)),'_',' '),pos(':',waves.i) + 1)||'8svx'
- call delete(outname)
- address command 'Xto8SVX "'waves.i'" 'outname
- end
- return
-