View Single Post
Old 10-10-2022, 11:01 AM   #421
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 11,120
Karma: 77213683
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Quote:
Originally Posted by chaley View Post
First question: what is a "topmost tag"? It seems that it is the first first hierarchical component of the first tag on the list, but as you can't depend on the order of tags in the list that seems wrong.

What do you want to have happen if the first tag is '[Cleanup]'? Do you want the second tag? if so then this would work:
Code:
	t = sublist($tags, 0, 1, ',');
	if t == "[CLEANUP]" then
		t = sublist($tags, 1, 2, ',')
	fi;
	re(t, '^(.*?)($|\..*$)', '\1')
"Topmost tag" -- if 'Fiction.Mystery.Cozy Mystery', then 'Fiction.' If 'Nonfiction.Biographies & Memoirs', then 'Nonfiction.' I call it that because in the tag browser it appears at the top of the hierarchy.

And yes, just go to the next tag. Hopefully the code works.

Last edited by ownedbycats; 10-10-2022 at 11:33 AM.
ownedbycats is offline   Reply With Quote