get folder size

If I try to get the size of a folder that contains a folder with “no access” permissinos, I get an error. How can I get the size?

do shell script “du -sk " & selectedFolder & " 2>& 1” doesn’t work.


How about

do shell script "du -sk " & quoted form of posix path of (selectedFolder as text) & " 2>& 1"


  • Dan

No, doesn’t work.
Make a folder A containing a folder B, change the Ownership & Permissions of folder B to “No Access” (in the info panel) and run the script:
do shell script “du -sk " & quoted form of “/Users/yourName/Desktop/A” & " 2>& 1”. You get this error…