Sure. v2 does both. It detects if folders are selected and searches only those. If nothing is selected it searches whole computer. I now have the fourth item for counting all 3 tags.
Code: Select all
//TagCounter v2
//Counts Labels, Comments, Tags or all three in "My computer" or selected items
"_getselected"
global $path;
focus;
IF (<get CountSelected> < 1){
$path=%computer%;
}
ELSE {
FOREACH($folder, <get SelectedItemsPathNames |>){
IF(exists($folder)==1){
end 1==1, "Select ONLY folders.<crlf>To search whole computer remove all selections";
}
ELSE{
$path=get("SelectedItemsPathNames", ";");
}
}
}
"Labels|:labels"
global $lookup, $lookup2;
$lookup=Label;
$lookup2=lbl;
sub "_getcount";
"Comments|:udc"
global $lookup, $lookup2;
$lookup=Comment;
$lookup2=cmt;
sub "_getcount";
"Tags|:tagsfind"
global $lookup, $lookup2;
$lookup=Tags;
$lookup2=tags;
sub "_getcount";
"-"
"All above"
global $lookup, $lookup2, $tab, $path;
sub "_getselected";
$tab= tab ("get");
copytext;
$lookup=Label;
$lookup2=lbl;
sub "_getallcount";
$lookup=Comment;
$lookup2=cmt;
sub "_getallcount";
$lookup=Tags;
$lookup2=tags;
sub "_getallcount";
$path=replace ($path,";","<crlf>");
text "Paths<crlf>$path<crlf><crlf><clipboard>",,,,w;
seltab $tab;
"_getcount"
global $lookup, $lookup2, $path;
$tab= tab ("get");
sub "_getselected";
goto "$path?$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>;
$path=replace ($path,";","<crlf>");
text "Paths<crlf>$path<crlf><crlf>Total $lookup=$total<crlf><crlf>$list",,,,w;
seltab $tab;
"_getallcount"
global $lookup, $lookup2, $tab,$path;
goto "$path?$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>;
copytext "Total $lookup=$total<crlf>$list<crlf><crlf>",a;