monolithpl / stexbar

Windows Explorer extensions (or: what Microsoft forgot to implement in the Windows Explorer)
7 stars 4 forks source link

"qsize" AutoHotKey script submission #19

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
/*
calculate the size of the selected files/folders (recursive)

sure... Alt-Enter gets you the property page for all the selected
items, which also has the size.  But this way is much quicker when
used repeatedly (like trying to guess what combination of items
will fit perfectly on a DVD)

I found this thing invaluable when trying to do the above mentioned task
on a slower network folder (right clicks took insanely long, and 
I didn't need to see a full property page... just the size and number of
items).

The results pop up as a tool tip when their ready, and hang around for five
seconds.

A new size request does not cancel the first one (multiple tooltips will
show up without
issue)

*/
    unit_list =B KB MB GB TB PB EB ZB YB
    ;I await the day when I'll be using such large units!! (Oh, its only 1.4
ZB...)

    StringSplit, units, unit_list, %A_Space%
    TotalSize:=0

    num_files := 0

    Loop %0%
    {
        file := %A_Index%
        FileGetSize, size, %file%
        TotalSize += %size%

        FileGetAttrib, Attributes, %file%

        IfInString Attributes, D
        {
            Loop, %file%\*.*, , 1
            {
                num_files++
                TotalSize += %A_LoopFileSize%   
            }       
        }
        else
            num_files++
    }

    Loop
    {
        unit := units%A_Index%
        if TotalSize < 1024
            break
        TotalSize := TotalSize / 1024.00
    }

    ToolTip, Size: %TotalSize% %unit% in %num_files% files
    sleep 5000
    ToolTip
return

Original issue reported on code.google.com by kijoshua...@gmail.com on 2 Aug 2008 at 4:03

GoogleCodeExporter commented 9 years ago

Original comment by tortoisesvn on 2 Aug 2008 at 4:18

GoogleCodeExporter commented 9 years ago
Compiled version (doesn't require AutoHotKey to run)

Original comment by kijoshua...@gmail.com on 2 Aug 2008 at 4:38

Attachments:

GoogleCodeExporter commented 9 years ago
not to take away from the usefulness of this script but I use another explorer 
addin 
called FolderSize (http://foldersize.sourceforge.net/).  It adds another column 
(or 
columns, it has a number of settings) that shows the size of all folders/files.

Original comment by jst...@mailjar.com on 12 Jun 2009 at 7:20