Code: Select all
//TagCounter
//Counts Labels, Comments or Tags in "My computer"
"Label"
global $lookup, $lookup2;
$lookup=Label;
$lookup2=lbl;
sub "_getcount";
"Comment"
global $lookup, $lookup2;
$lookup=Comment;
$lookup2=cmt;
sub "_getcount";
"Tags"
global $lookup, $lookup2;
$lookup=Tags;
$lookup2=tags;
sub "_getcount";
"_getcount"
global $lookup, $lookup2;
$tab= tab ("get");
goto "%computer%?$lookup2:?*";
setting "SortFoldersApart",0;
setting "KeepFoldersOnTop",0;
sortby $lookup, a;
$tags = report ("{$lookup}|");
$tags = formatlist($tags,"ed","|");
$lblcount= gettoken($tags, "count","|");
$count=1;
$report="";
WHILE($count<=$lblcount){
$filter=gettoken($tags, $count,"|");
selfilter $filter,,"$lookup";
$filtercount=<get countselected>;
$report= "$report<crlf>$filter=$filtercount";
$count++;
}
filter;
$list= formatlist($report,"e","<crlf>");
$total=<get countitems>;
seltab $tab;
text "Total=$total<crlf><crlf>$list";
Update: changed search to variable %computer%
Update 2: Added total count
Bug fix (31Mar2012): Fixed a bug with sorting folders apart
XYplorer Beta Club