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
Labels and Tags confusion
-
- Posts: 49
- Joined: 16 Mar 2018 17:20
Labels and Tags confusion
- Attachments
-
- Screenshot skeptics and believers
- Tag Mystery.png (86.6 KiB) Viewed 2420 times
Re: Labels and Tags confusion
Say "The Fountainhead - Ayn Rand.pdf" had these tags: fiction, philosophical.zmachine01 wrote: ↑14 Feb 2019 02:34I don't understand what it means to "add" a tag to a file/folder and to "set."
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 ]
[ this user is asleep ]
Re: Labels and Tags confusion
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.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.
[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;
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]
[ this user is asleep ]
Re: Labels and Tags confusion
Tags for "Atlas Shrugged" will be the same, except in all-caps. Shouldn't be a problem here, though.
-
- Posts: 49
- Joined: 16 Mar 2018 17:20
Re: Labels and Tags confusion
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