Playsound with Variable Sound File Name

I want to play sounds when a procedure is executed but would like that the sound can be chosen or a variable vs. Hard Wired.

I am using the following code:

   Playsound “/Users/George/Desktop/Address Master - Panorama X/Pan X Sounds/Stetson.mp3”

The above works fine but If I give the mp3 file name a variable it does not work.

like below

 Playsound “/Users/George/Desktop/Address Master - Panorama X/Pan X Sounds/LSoundName”

Even though a File Global Variable is given the file name:

      FileGlobal  LSoundName

      LSoundName="Stetson.mp3"

I have even assigned a FileGlobal Variable the entire file path with no luck.

Is what I am trying to do possible?

Thanks

You have to move the variable out of the quoted path:

Playsound “/Users/George/Desktop/Address Master - Panorama X/Pan X Sounds/"+LSoundName
1 Like

Thanks Gary,

It seems I tried every way but the right way!

Thanks for bailing me out again.

George