With playing sounds, there are two ways I know of.
The first is a shell command.
do shell script "afplay /Users/Joey/Destop/myAudioFile.aif"
Put the path to the sound as a POSIX path…
set fileWithoutPosix to (choose file with prompt "Choose audio file to play:")
set fileAsPosix to POSIX path of fileWithoutPosix
do shell script "afplay " & quoted form of fileAsPosix
The other way is to download the application “Play Sound” by clicking here. Drag the application to AppleScript Editor to see its dictionary.
set theURLs to {"http://www.apple.com", "http://www.apple.com", "http://www.apple.com", "http://www.apple.com", "http://www.apple.com", "http://www.apple.com", "http://www.apple.com", "http://www.apple.com", "http://www.apple.com", "http://www.apple.com"}
display dialog "Pick a number from 1 to 10." default answer ""
try
open location (item (text returned of the result) of theURLs)
on error
display dialog "Invalid number." buttons "OK" default button "OK"
end try
now i need to know how to set it up so that, when they pick it it will say what they picked, separate for each URL selection, a display dialog basically
set chosenURL to (choose from list theURLs) as string
if chosenURL does not equal "false" then open location chosenURL
Choose from list returns false when the user cancels. In this case, since the result of choose from list is being converted to string, false is now “false”.