Applescript variable not being passed I have a basic applescript to request a user's input, then pass the variable into a path for mounting a volume:

display dialog "What is the first letter of your last name?" default answer ""
set LastNameInitial to text returned of result

mount volume "smb://ServerName/files/myfiles/LastNameInitial"


However, when this is executed, it fails to mount the volume as it does not exist because it is trying to mount the literal path above and not using the variable. What am I doing wrong?
You need to just add the variable to the end of your predetermined path string, like this…

set LastNameInitial to ""
repeat while LastNameInitial is ""
    display dialog "What is the first letter of your last name?" default answer ""
    set LastNameInitial to text returned of result
    if LastNameInitial is not "" then
        mount volume "smb://ServerName/files/myfiles/" &amp; LastNameInitial
    end if  
end repeat


I added a safety net just in case they don't enter an initial, which will keep springing the same dialog until they do, or cancel