Labels and Tags confusion

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
zmachine01
Posts: 41
Joined: 16 Mar 2018 17:20

Labels and Tags confusion

Post by zmachine01 »

I've been trying to better figure out how tags and labels work and what the difference is between them. I don't understand what it means to "add" a tag to a file/folder and to "set." I did some experimenting by adding/applying some tags to a couple files and then saving the tag data using the 'savesettings 64 "trashme.ini";' string, since I do not save my main settings or config while exiting XYplorer. When I exit XY and come back, the "Tag List Is Empty." Yet when I search with "Find All," the files I tagged in the last session are returned in the search. So there are tags, they just don't show up in the tag list. Plz see attachment

??
Thanks
Attachments
Screenshot skeptics and believers
Screenshot skeptics and believers
Tag Mystery.png (86.6 KiB) Viewed 2122 times

bdeshi
Posts: 4249
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: Labels and Tags confusion

Post by bdeshi »

zmachine01 wrote: 14 Feb 2019 02:34I don't understand what it means to "add" a tag to a file/folder and to "set."
Say "The Fountainhead - Ayn Rand.pdf" had these tags: fiction, philosophical.
After adding the tags "individualism", "objectivism" the file's taglist becomes: "fiction, individualism, objectivism, philosophical".
After setting the tags "doorstop", "pages and more pages", the file's taglist becomes: "doorstop, pages and more pages".
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

bdeshi
Posts: 4249
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: Labels and Tags confusion

Post by bdeshi »

zmachine01 wrote: 14 Feb 2019 02:34I did some experimenting by adding/applying some tags to a couple files and then saving the tag data using the 'savesettings 64 "trashme.ini";' string, since I do not save my main settings or config while exiting XYplorer. When I exit XY and come back, the "Tag List Is Empty." Yet when I search with "Find All," the files I tagged in the last session are returned in the search. So there are tags, they just don't show up in the tag list.
The "tag list" doesn't list all existing tags (they're saved in the tag database, tag.dat), it's just a list of the tags you've manually entered. It's there to save you the trouble of typing out recently applied tags repeatedly. but since the list is saved in <xyini>, and you're not saving the ini, XY will forget it upon restart.

[ed.]
The disassociation between the taglist and the tag database is intended. You can set up different tag lists for different occasions. You can preseed the list with tags that you intend to apply to files in the near future. Anyway, populating the taglist with all existing tags is not implemented for performance reasons probably, but you can use this script to do so. Just run it after starting XY.
Open Main Menu > Scripting > Run Script, copy-paste the code into the text box and press OK.

Code: Select all

  $tagdb = tagexport("<xydata>\Temp\tagdb","");
  $tagdb = readfile($tagdb);
  $taglist = taglist();
  $header = 0;
  foreach ($record, $tagdb, <crlf>) {
    if ($header == 0) {
      if ($record == 'Data:') {
        $header = 1;
      }
    }
    elseif ($header == 1) {
      $tags = gettoken($record, 3, '|');
      if !($tags) { continue; }
      foreach ($tag, $tags, '; ') {
        if !(gettokenindex($tag, $taglist, '; ')) {
          $taglist .= "; $tag";
        }
      }
    }
  }
  taglist(regexreplace($taglist, '^[; ]+'));
  #881;
The script will open the "Add Tags..." dialog at the end, you don't have to do anything there, just ensure the "Add new tags to tag list" option is checked and click OK.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

Papoulka
Posts: 455
Joined: 13 Jul 2013 23:41

Re: Labels and Tags confusion

Post by Papoulka »

Tags for "Atlas Shrugged" will be the same, except in all-caps. Shouldn't be a problem here, though.

zmachine01
Posts: 41
Joined: 16 Mar 2018 17:20

Re: Labels and Tags confusion

Post by zmachine01 »

Thanks for the info. I'm starting to think I might need to approach my broader issue in a different way. I will post to the main forum

Post Reply