Quicktime error

Newbie here. I tried to create a small script to play a .wav file during startup. Using the Script Editor, I opened the file, played it, and quit Quicktime. The script displayed in the Script Editor window, but when I ran it, I got an error message stating: Quicktime Player got an error: movie “anticipation.wav” doesn’t understand the “play” message.

How can it not understand the “play” message, when the script editor itself put it in?

This is the entire script:

tell application “QuickTime Player”
activate
play movie “anticipation.wav”
quit
end tell

I have Quicktime Player 6.1 and Script Editor 1.9

Thanks for any help you can give,
Doug

You should open the file before playing it?

tell app "QuickTime Player"
     open alias "path:to:sound.aif"
     play movie 1
end

Anyway, you may find useful Jon’s Commands’ command “play sound”, which will play your selected sound without the need to open an app:

play sound alias "path:to:sound.sfil"

(sfil is “system 7 sound” format, otherwise it won’t work)
You can take a look to Jon’s Commands’ latest version at http://www.seanet.com/~jonpugh/