Like Horstl said, you just type /run filename.ext . You don't have to specify the program to open it in. It will automatically open in whatever program the user has set up for that extension. If one person has .txt open in notepad and another has .txt open in wordpad, then /run will open text files in the program that they have selected.
You can just get rid of your alias and use the following:
run $line(@window,$1,1)
Though I would probably recommend using $qt() to handle any potential issues with spaces.
run $qt($line(@window,$1,1))