An AppleScript to toggle 'Calculate folder sizes'

May 13, '04 10:32:20AM

Contributed by: magir

Quite a simple hint which toggles the Finder's list view option to Show folder sizes using an AppleScript. By saving the script as an application and adding it to the toolbar, you get a simple and fast method to switch on and off "Calculate all sizes" for the frontmost window. Simply paste the following text in the Script Editor and save it as Application (with no startup screen).

tell application "Finder"
 if calculates folder sizes of the list view options ¬
 of the front window is true then
  set calculates folder sizes of the list view options ¬
  of the front window to false
 else
  set calculates folder sizes of the list view options ¬
  of the front window to true
 end if
end tell
There are many ways to enhance this script: [robg adds: I tested it, and it works as described.]

Comments (13)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20040511092122423