Simple AppleScript working with QuickTime (sound files)
I am trying to write a simple script to open and play a sound file (.mp3 format). It works fine outside the script, simply opening the file in Finder using the QuickTime Player app seems perfectly compatible (plays the sound).
This fails, why?
tell application "QuickTime Player"
set sndAlarm to open POSIX file "~/Library/Sounds/Alarm.mp3"
play sndAlarm
end tell
MacBook Air 15″, macOS 15.1