The explanation helps. If you are very sure that the defaultFolder is the one containing the app (and therefore the subfolder) then you don't need to go up a level ("../") and then back down again to the default folder. Just check if there is a folder with the name you need, and a file inside that. Also, unless you will need to reference it later, it's faster to omit the field storage and just use a variable. But a field won't hurt.
Code: Select all
set the itemDelimiter to "/"
answer file "Pick a file:"
if it = "" then exit to top
put "FLAn_Audio/" & last item of it into thefiletoPlay
if there is no file thefiletoPlay then -- check existence
answer "No file found."
exit to top
else
set the filename of player "jokeaudio" to tPath
end if