folder permissions

Hi, need help, I created a simple applescrit to get the persmissions of a folder some times it works and I get a big number something like this: 40777. but some times I get an error like this: stat: No such file or directory. I still dont know why… any idea how to fix this? :frowning:

here is the code:

set the_folder to (choose folder with prompt "Choose a Folder") as Unicode text
set the_path1 to POSIX path of the result
do shell script "stat -f %p " & the_path1

You need to quote the path:

do shell script "stat -f %p " & quoted form of the_path1

Thank you it did work… but the full applescript did not will add a new topic hoping someone can help ;(