alias playrange {
var %x = $iif(-* iswm $1,$1),%y = $iif($gettok($1-,-1,32) isnum,$v1)
if b isin %x { echo -aic i * /playrange: Can't use the -b switch | return }
if a isin %x { var %x = $1-2 | tokenize 32 $3- }
elseif %x { tokenize 32 $2- }
if !$4 || $2 < $1 || $1 == 0 || $2 == 0 {
echo -aic i * Syntax: /playrange [switches] [alias] <start> <stop> <target> <file name> [delay]
return
}
if %y { tokenize 32 $($+($,1-,$calc($0 -1)),2) }
var %i = $lines($4-)
if %i < $1 { echo -aic i * /playrange: Range out of bounds | return }
if %i < $2 { tokenize 32 $1 %i $3- }
var %a = $ticks
filter -ffr $+($1,-,$2) $+(",$remove($4-,"),") %a
play %x $3 %a %y
.remove %a
}