!Filename Thread last updated on 2003-04-04 05:46:22

Posted by member 7223 on 2003-04-04 05:46:22

Hope this script will be usefull

; !Filename
; IN:
; - %{args} = Path\Filename.ext
; OUT:
; - %{Fullname} = Path\Filename.ext
; - %{Filename} = Filename.ext
; - %{FileExt} = ext
; - tmp, Path modified


*Script Bang !Filename
*Script Exec !SetListSep \
*Script Exec !VarSet Fullname %{args}
*Script Exec !VarSet tmp "%{Fullname:_}"
*Script Exec !VarSet Path "%{Fullname:}"
*Script Label ExtractPath
*Script Exec !IfEval ("%{tmp}" "%{tmp:}") |VarSet Path "%{Path}\%{tmp:}"
*Script Exec !VarSet Filename "%{tmp}"
*Script Exec !VarSet tmp "%{tmp:_}"
*Script GotoIf ("%{tmp}" "%{tmp:_}") ExtractPath
*Script Exec !SetListSep .
*Script Exec !VarSet tmp "%{Filename:_}"
*Script Exec !VarSet Filename "%{Filename:}"
*Script Label ExtractFullname
*Script Exec !VarSet FileExt "%{tmp}"
*Script Exec !VarSet tmp "%{tmp:_}"
*Script Exec !IfEval ("%{tmp}" "%{tmp:_}") |VarSet Filename "%{FileName}.%{FileExt:}"
*Script GotoIf ("%{tmp}" "%{tmp:_}") ExtractFullname
*Script ~Bang