change default app for a file type depending on location of file

I would really appreciate some help on a script - or even just a word or two to let me know if there is an easier way to do what I want, or indeed if it is even possible!

I would like to open avi files with a different programme depending on their location. I normally use VLC to watch locally stored avi’s, but VLC handles files on network drives particularly badly and playback is very jumpy. Quicktime Player plays back the same files perfectly. So I would like to create an application called “avi launcher.app” and select that as my default app for launching avi’s. The application will basically be a script that looks at whether or not the file is stored locally on the computer, and if it is, will open in VLC and if not, will open in Quicktime Player.

Many thanks for any suggestions

Hi,

try this

set theFile to choose file
tell application "Finder"
	if (local volume of disk of theFile) then
		open theFile using (path to application "VLC")
	else
		open theFile using (path to application "QuickTime Player")
	end if
end tell