.key Infile/A,Type
.default Type 8svx

; AmigaDOS Script For Handling Simple Conversions With SOX.
; By Peter Bengtsson <a94petb@ida.his.se> 960119.

; Syntax is : x2y <Filename[.ext]> [Type]
; Where type is one of {iff,8svx,voc,vaw,au,aiff}

Set AFile <InFile>

If Not Exists "$AFile"
   Set AFile `List <InFile>.(voc|wav|8svx|iff|au|aiff) LFormat="%n" Files`
   If "$AFile" EQ "<InFile>"
      Echo "*"*E[2m<InFile>*E[22m*" : No such file."
      Skip End
   Else
      If Not Exists "$AFile"
         Echo "No singular completion of *"*E[2m<InFile>*E[22m*" possible."
         Skip End
      EndIF
   EndIf
EndIf

Sox -t AUTO "$AFile" "`List "$AFile" LFormat="%m"`.<Type>"

Lab End

UnSet AFile
