Page 1 of 1

Deleted label

Posted: 24 Feb 2012 16:48
by serendipity
I had 11 labels and labeled some of my items as the 11th label which was chocolate color.
Somewhere along i happened to delete few labels in config>tags section including the 11th one and now my label column for the items labeled chocolate color show as text "011".
This is nice because I know that I deleted a label but there are still items tagged with 011 label.
Is this an intended feature I happen to discover or just a side effect?
Plus I am able to search my orphans from find files labels by entering 011.
Nice!

Update: I guess if you delete orphaned tags this won't work anymore.
Can there be an improvement in the config>tags section where each label shows how many items are labeled? That way I know when not to delete a label.

Re: Deleted label

Posted: 25 Feb 2012 10:26
by admin
1. Intended. Deleting a label does not unlabel files.

2. You can simply do a search lbl:?* and count. :)

Re: Deleted label

Posted: 25 Feb 2012 20:00
by serendipity
admin wrote: 2. You can simply do a search lbl:?* and count. :)
Thanks for the motivation, i got my own tag counter :P :

Code: Select all

//TagCounter
//Count Labels, Comments or Tags.
"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:?*"; 
  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;
  seltab $tab;
  text formatlist($report,"e","<crlf>");
  

Re: Deleted label

Posted: 25 Feb 2012 21:12
by admin
Hey, nice one! Works fine here after one change to adjust to different systems/locales:

Code: Select all

OLD: goto "Computer?$lookup2:?*"; 
NEW: goto "%computer%?$lookup2:?*";
Or even simpler:

Code: Select all

goto "*?$lookup2:?*";

Re: Deleted label

Posted: 25 Feb 2012 21:15
by serendipity
admin wrote:Hey, nice one! Works fine here after one change to adjust to different systems/locales:

Code: Select all

OLD: goto "Computer?$lookup2:?*"; 
NEW: goto "%computer%?$lookup2:?*";
Or even simpler:

Code: Select all

goto "*?$lookup2:?*";
Oh yes, thanks! fixed.
Updated few things here:
http://www.xyplorer.com/xyfc/viewtopic. ... 988#p69988