Well I made this little alias to do what you want.
Assumptions/behavior:
if file doesn't exist returns 0
if there are 4 aliases and you ask for 5 it will return 0
assumes aliases are formatted like "alias aliasname " in the script file
alias aliasname {
if ($isfile($1)) && ($2 isnum 0-) {
set -l %num 0
while ($read($qt($1),r,^alias(\x20-l|) (.*?)\x20,$calc($readn + 1))) { set -l %a $addtok(%a,$regml(2),32) | inc %num }
if ($2 == 0) return %num
elseif ($2 isnum 1-) return $iif($gettok(%a,$2,32),$v1,0)
}
else return 0
}
;updated to work with alias -l, forget about that at first
Hope it works for you, it was fun to make
I based this off of the format that aliases use in normal script files, if you are using an alias script file or an ini based script file let me know and I can change it work with the other formats.