Why QT Player when i ask for VLC

I have this script that find the latest file in a folder. Then I ask VLC to open the file.
Why is it that QuickTime then takes over and open the file instead?


tell application "Finder"
	set sti to "/Volumes/drive2/Projects/meetings/20101008" as POSIX file as alias
	set filelist to files in sti whose name ends with ".mp4"
	set filelist to sort filelist by creation date
	set filnavn to first item in filelist
	get filnavn
end tell

tell application "VLC"
	activate
	open filnavn
end tell

If i type this instead it works fine


tell application "VLC"
	activate
	open "/Volumes/drive2/Projects/meetings/20101008/170.mp4"
end tell

What do I do?

VLC is looking for an alias, not a file reference. Your “get filnavn” didn’t seem to be doing anything.

This worked for me:

tell application "Finder"
	set sti to "/Volumes/drive2/Projects/meetings/20101008" as POSIX file as alias
	
	set filelist to files in sti whose name ends with ".mp4"
	set filelist to sort filelist by creation date
	set filnavn to first item in filelist as text
	
end tell

tell application "VLC"
	activate
	open file filnavn
end tell

Thanks. That solved my problem.

.
tell application "Finder"
   set sti to "/Volumes/drive2/Projects/meetings/20101008" as POSIX file as alias
.

is around a few corners

tell application "Finder"
   set sti to alias "drive2:Projects:meetings:20101008:"

does the same thing without coercions