home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
17 Bit Software 1: Collection A
/
17Bit_Collection_A.iso
/
files
/
1112.dms
/
1112.adf
/
JMenu
/
unpack
< prev
next >
Wrap
AmigaDOS Script File
|
1988-07-25
|
3KB
|
100 lines
.KEY source/k,dest/k,label/k
.DEF source "dh1:telecom/downloads/"
.DEF dest "ram:"
.DEF label FirstMenu
;
failat 20
skip <label>
; -------------------------------------------------------------------------
; This is a script using JMenu. It allows you to select an
; archive program (LHarc, Zoo, etc.) and a file to unpack.
;
; format: execute unpack (SOURCE SourceDir) (DEST DestDir)
: note: if the source or destination are subdirectories they must end
; with a "/"
; -------------------------------------------------------------------------
lab FirstMenu
;
; show archive programs menu
; 'unpack.menu1' contains the menu definition
; 'selection1' is the environment variable which will equal the
; user's choice
;
JMenu >NIL: s:unpack.menu1 selection1
if $selection1 eq 1
quit ;user selected Quit from menu
endif
if $selection1 eq 2
Pkazip
skip SKIPFIRST
endif
;
; If choice 3, 4 or 5 build a menu of available files.
; An error will occur if there are more files than can be displayed on
; the menu.
;
setenv dcsource <source>
cd <source>
if $selection1 eq 3 ;display menu of #?.lzh
echo >ram:dir.menu "TITLE Directory of LZH files"
echo >>ram:dir.menu "TITLE Choose a file to unpack"
echo >>ram:dir.menu "MENU Never mind"
echo >>ram:dir.menu "EXEC"
list >>ram:dir.menu #?.lzh LFORMAT="MENU %s"
list >>ram:dir.menu #?.lzh LFORMAT="EXEC SetEnv dcfile %s"
setenv dcmethod Lharc
setenv dcstring " -x -m -a e "
endif
if $selection1 eq 4 ;display menu of #?.zoo
echo >ram:dir.menu "TITLE Directory of ZOO files"
echo >>ram:dir.menu "TITLE Choose a file to unpack"
echo >>ram:dir.menu "MENU Never mind"
echo >>ram:dir.menu "EXEC"
list >>ram:dir.menu #?.zoo LFORMAT="MENU %s"
list >>ram:dir.menu #?.zoo LFORMAT="EXEC SetEnv dcfile %s"
setenv dcmethod Zoo
setenv dcstring " e "
endif
if $selection1 eq 5 ;display menu of #?.arc
echo >ram:dir.menu "TITLE Directory of ARC files"
echo >>ram:dir.menu "TITLE Choose a file to unpack"
echo >>ram:dir.menu "MENU Never mind"
echo >>ram:dir.menu "EXEC"
list >>ram:dir.menu #?.arc LFORMAT="MENU %s"
list >>ram:dir.menu #?.arc LFORMAT="EXEC SetEnv dcfile %s"
setenv dcmethod Arc
setenv dcstring " e "
endif
;
lab SecondMenu
;
; show file names menu
; 'dir.menu' contains the menu definition
; 'selection2' is the environment variable which will equal the
; user's choice
jmenu >nil: ram:dir.menu selection2
if ERROR
echo "Too many files to display on menu."
quit
endif
if $selection2 eq 1 ;never mind was chosen
skip SKIPFIRST
endif
;
; create single line script to execute selected program with parameters
;
join env:dcmethod env:dcstring env:dcsource env:dcfile AS ram:temp
cd <dest>
execute ram:temp
skip SKIPSECOND
;
; since you can't skip backwards, re-execute this script with a label name
;
lab SKIPSECOND
execute unpack SOURCE <source> DEST <dest> LABEL SecondMenu
quit
lab SKIPFIRST
execute unpack SOURCE <source> DEST <dest>
quit