Until someone more knowledgeable comes along with a better answer you could try looking at the code in one of the other calibre user interface plugins. For instance, I know the Count Pages plugin can do metadata updates on custom columns for PageCount and WordCount.
|