I am new and learning applescript. Can anyone help me with this script. I am simply trying to list the size of the folders.
Seems very simple, but I can’t figure out what I am doing wrong.
Please advise.
set folderSelected to choose folder "Select a folder"
tell application "Finder"
set listOfFolders to every folder of folderSelected
end tell
set theList to {}
repeat with aFolder in listOfFolders
set theSize to size of aFolder
set theList to theList & theSize
end repeat
Browser: Safari 536.28.10
Operating System: Mac OS X (10.8)
set folderSelected to choose folder "Select a folder"
tell application "Finder"
set listOfFolders to every folder of folderSelected
set theList to {}
repeat with aFolder in listOfFolders
set theSize to size of aFolder
set end of theList to theSize
end repeat
end tell
return theList
Correct, but not all folders are actually calculated. There is an possibility the script will wait forever, so an timeout using maximum attempts should be added as well.