Page 1 of 1

EverythingFolderSize column (Calculate folder sizes via Everything tool)

Posted: 24 Jul 2022 01:11
by Norn
Index folder size.png
Index folder size.png (22.14 KiB) Viewed 3300 times
EFS.PNG
EFS.PNG (16.26 KiB) Viewed 3300 times
Split into two parts, faster! Everything tool must be running!

To -> Configuration | General | Custom Event Actions | Before browsing a folder.

Code: Select all

/*
***************************************************************************************************
@Author  : https://www.xyplorer.com/xyfc/viewtopic.php?t=24909
@Created : 2022-07-23
@Function: EverythingFolderSize column (Calculate folder sizes via Everything tool)   Configuration | General | Custom Event Actions | Before browsing a folder
@Version : v2.0 (2024-07-15)
***************************************************************************************************
*/


    $EVsizeResults = "";
    if ($exec != 1 && exists(<newpath>)) {
        $es = """<xyscripts>\EV FOR XY\es.exe""";                                // es.exe path, Everything tool must be running
        if(!exists("%temp%\EFS\")) {new("%temp%\EFS", "dir")}                    // Make sure the path exists
        $txt_EFS = "%temp%\EFS\" . now("yymmdd-hhnn-ss.ff") . ".txt";            // Temp file path
        $content = "parent:""<newpath>"" /ad -size -no-header -export-csv";      // To search for
        run "$es $content $txt_EFS",,, 0;                                        // Run cmd
        wait 100;
    }

    perm $txt_EFS, $EVcase = $EVcase+1, $EVsizeResults;     // Global variables
To -> Custom column.

Code: Select all

/*
***************************************************************************************************
@Author  : https://www.xyplorer.com/xyfc/viewtopic.php?p=210711#p210711
@Created : 2022-07-23
@Function: EverythingFolderSize column (Calculate folder sizes via Everything tool)
@Version : v2.0 (2024-07-15)
***************************************************************************************************
*/


    if (!$EVsizeResults && exists($txt_EFS) == 1) {
        perm $EVsizeResults = readfile($txt_EFS)
    }
    if (!$EVsizeResults) {return}
	
	$cc_item = regexreplace(<cc_item>, "([\[(|#])", "*");
	$EVitem = formatlist($EVsizeResults, "f", "<crlf>", "*" . $cc_item . '"');
	if ($EVitem) {
		return formatbytes(gettoken($EVitem, 1, ',"'), "FLEX")
	} else {
		return
	}
EverythingFolderSize column.gif
EverythingFolderSize column.gif (1.02 MiB) Viewed 2672 times
ES Command Line Tool for Everything, or
EV FOR XY.zip
(453.1 KiB) Downloaded 148 times
Toggle display of folder sizes:

Code: Select all

if ($exec != 1) {
    perm $exec = 1, $EVsizeResults = "", $txt_EFS = "";
    status "EFS off!";

    if ($EVcase > 50) {                                     // Clearing temp files
        delete 0, 0, "%temp%\EFS";
        perm $EVcase = "";
        status "EFS off! (Cache cleared)";
    }
 } else {perm $exec = 0; status "EFS on!"}

Re: EverythingFolderSize column (Calculate folder sizes via Everything tool)

Posted: 13 Jul 2024 23:46
by Norn
AutoHotkey v2 integrated version, no cache files are generated.

Notes:
  • Place the "EV FOR XY" folder in the archive into the Scripts folder
    EV FOR XY.zip
    (156.89 KiB) Downloaded 114 times
    To -> Configuration | General | Custom Event Actions | Startup

    Code: Select all

    open "<xyscripts>\EV FOR XY\es.ahk"
    To -> Configuration | General | Custom Event Actions | Before browsing a folder

    Code: Select all

    /*
    ***************************************************************************************************
    @Author  : https://www.xyplorer.com/xyfc/viewtopic.php?t=24909
    @Function: EverythingFolderSize column (Calculate folder sizes via Everything tool)   Configuration | General | Custom Event Actions | Before browsing a folder
    @Created : 2022-07-23
    @Version : v2.0A (2024-07-15)
    ***************************************************************************************************
    */
    
    
        if ($exec != 1 && exists(<newpath>) && $es_hwnd) {
            perm $es_results = "";
            copydata $es_hwnd, "<newpath><crlf><hwnd>", 0;
        }
    Type ::snippet in the address bar
    Then copy and paste the text below and click OK, finally add a column and select custom column EFS, need to restart XYplorer

    Code: Select all

    Snip: CustomColumn 1
      XYplorer 26.20.0107, 2024/7/14 2:04:31
    Action
      ConfigureColumn
    Caption
      EFS
    Type
      3
    Definition
       /*
      ***************************************************************************************************
      @Author  : https://www.xyplorer.com/xyfc/viewtopic.php?t=24909
      @Function: EverythingFolderSize column (Calculate folder sizes via Everything tool)
      @Created : 2022-07-23
      @Version : v2.0A (2024-07-15)
      ***************************************************************************************************
      */
      
      
     	if ($exec == 1) {return}
      	if (!$es_results)
      	{
      		for ($i=0; $i<200; $i++)
      		{
      			if ($es_results) {break}
      			wait 3;
      		}
      	}
      
      	if (!$es_results) {return}
    	$cc_item = regexreplace(<cc_item>, "([\[(|#])", "*");
    	$EVitem = formatlist($es_results, "f", "<crlf>", "*" . $cc_item . "*");
    	if ($EVitem) {
    	   return formatbytes(gettoken($EVitem, 1, ',"'), "FLEX")
    	} else {
    		return
    	}
    Format
      0
    Trigger
      1
    Item Type
      1
    Item Filter
    Toggle display of folder sizes:

    Code: Select all

    	if ($exec != 1) {
    		perm $exec = 1, $es_results = "";
    		status "EFS off!";
    	} else {perm $exec = 0; status "EFS on!"}
Changes
  • Corrected the regular expression and command line
    Improved custom column