set a to choose folder
set b to POSIX path of a
do shell script "chmod -R 777 " & quoted form of b
-- note the space after 777 to so the file path won't abut it.
If the file doesn’t need to be executed I wouldn’t use 777 but I would use 666 instead. With 666 you say everybody can read and write but nobody can execute the file. If it is an executable I prefer 555 over 777. When the file is a shell script I prefer 755 so the owner is the only one who can change the script.