Hi, I am trying to create an application bundle that plays a sound when opened. I am using a python helper script available from this link: http://files.macscripter.net/joy/files/macsound.py
instead of the main(), however, I have replaced the contents with the following code.
property myname : "Sauterbraten"
on run
my main()
end run
on main()
try
-- searching for the sound files
set soundfiles to ""
set soundfile to ("(path to me):Contents:Resources:RickRollD.aiff")
set soundfile to POSIX path of soundfile
set soundfiles to soundfiles & space & quoted form of (POSIX path of soundfile)
-- playing the sound files using a Python script utilizing NSSound
set pyscript to POSIX path of (((path to me) as Unicode text) & "Contents:Resources:macsound.py")
set command to "python " & quoted form of pyscript & soundfiles
set command to command as «class utf8»
do shell script command
-- catching unexpected errors
on error errmsg number errnum
tell me
activate
display dialog "Sorry, an error occured" & return & return & errmsg & " (" & errnum & ")" buttons {"OK"} default button 1 with icon caution with title myname
end tell
end try
end main
However, I end up with an error with traceback to the macsound.py files. Can someone please help me?