Good day, I'm trying to figure out why sound files in a certain folder aren't playing for certain user's who run my application. My main issue here is that I have the sound files in a folder called, netutils/contents/resources/sounds. My secondary issue is that, the path of the sound files have to correspond to various volume names as the app runs on different mac's, who's volume names will be different from my own. I have the following code, which runs on my own Mac fine, but gives an error on other Mac computer's: use scripting additions use framework "Foundation" use framework "AppKit" set theFile to POSIX path of "Phoenix:Applications:netutils:sounds:logo.mp3" set theSound to current application's NSSound's alloc()'s initWithContentsOfFile:theFile byReference:false tell theSound to play()
The above code plays logo.mp3 from within the Phoenix:Applications:netutils:sounds folder. However, I am looking to have the code take into effect that the sounds should play from just the netutils/contents/resources/sounds folder while also having the code to realize that not all volume names will be the same as my own, for instance some volumes will be called MacHD, as an example.
So my question overall is, what path syntax can I use to achieve what I've outlined? Thanks for any help that can be provided. |