2004 - Folder Sizes?

W

Walt Basil

Any chance you can get the folder sizes in this version? That sure would be
handy!

What do you mean by folder sizes? The size of the folders in the Identity
folder? Size of the application folders?
 
B

Barry Wainwright

Any chance you can get the folder sizes in this version? That sure would be
handy!

Use this script:

-- Report Folder Size v1.0.0 (25th May 2004)
-- an applescript for Microsoft Entourage
-- by Barry Wainwright <[email protected]>

tell application "Microsoft Entourage"
set theSelection to selection
set totalSize to 0
try
set theSizes to (data size of every message of theSelection)
on error
display dialog "Please select a folder in the folder listing and run
this script again" buttons {"Quit Script"} default button 1 with icon stop
return -99 -- silent exit
end try
end tell
repeat with anItem in theSizes
set totalSize to totalSize + anItem
end repeat
if totalSize > 1024 ^ 3 then
set theSize to "" & ((totalSize / (1024 ^ 3) + 0.5) as integer) & "GB"
else if totalSize > 1024 ^ 2 then
set theSize to "" & ((totalSize / (1024 ^ 2) as integer) + 0.5) & "MB"
else if totalSize > 1024 then
set theSize to "" & ((totalSize / 1024 + 0.5) as integer) & "KB"
else
set theSize to "" & totalSize & " Bytes"
end if
set theMessage to "The size of folder \"" & name of theSelection & "\" is "
& theSize
display dialog theMessage buttons {"OK"} default button 1 with icon note
 
T

Tim S

Barry,

I am getting a syntax error here. An "&" error.

set theMessage to "The size of folder \"" & name of theSelection & "\" is "
---> & theSize
display dialog theMessage buttons {"OK"} default button 1 with icon note

Thanks for the help!
 
T

Tim S

Barry,

Scratch that last post. There was a line break causing the problem.
Got it figured out. It works!

Thanks!
Tim
 
B

Barry Wainwright

Replace all the 'as integer' with

div 1

if you don't mind rounding down

It won¹t round down ­ the (x+0.5)div 1 routine will round to the nearest
whole number, either up or down.
 
Top