View Single Post
Old 10-23-2021, 02:50 AM   #3
capink
Wizard
capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.
 
Posts: 1,200
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
You can use the template language to populate a custom column with the user categories.

Code:
program:
    user_categories()
You can update the column with calibre's search and replace (which supports using a template as an input field), or by using the Action Chains plugin.

Also, the template language should allow you to control what user categories should be included and what should not. For example, if you want only user categories starting with "Nationality." to be included:

Code:
program:
	res = '';
	for cat in user_categories():
		if '^nationality\.' in cat then
			res = list_union(res, cat, ',')
		fi
	rof;
        res

Last edited by capink; 10-23-2021 at 04:47 AM.
capink is offline   Reply With Quote