|
|
#1 |
|
Junior Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8
Karma: 1162
Join Date: Mar 2011
Device: Sony PRS-600
|
Automatically tag based on column info?
Longer explaination: I use the page count plug ins and I would like to split my books roughly by size. I.e. 10 pages or less, Micro, 10-25 pages, Tiny and so on. I'd like to have a Story Size column that set itself automatically to the size of the story based on the number of pages. So if the Page count column is updated to 17 pages, the Story Size column automatically sets itself to Tiny. Is this at all possible? If so, is it something one of you kindly souls would be willing to talk me through? (I hope this is the right forum, if not, my apologies!) |
|
|
|
|
|
#2 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,853
Karma: 285886
Join Date: Jan 2010
Location: France
Device: Sony PRS-300, HTC WM6.5, Samsung Galaxy Nexus, HTC Sensation
|
You can do this with columns built from other columns. You would use a General Program Mode template that returns a different value based on the number of pages. You would use "first_non_empty" and "cmp" to produce the correct values.
I am not currently in a position to write the template for you. Perhaps someone else can help out, should you need it.
__________________
Support calibre developers at no cost to you by using calibre's get books feature. Use Calibre Companion to wirelessly connect your Android phone or tablet to calibre charles.haleys.org/calibre |
|
|
|
|
Enthusiast
|
|
|
|
#3 |
|
Junior Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8
Karma: 1162
Join Date: Mar 2011
Device: Sony PRS-600
|
Thanks! I'll have a look at the link when I'm not quite so sleep deprived
|
|
|
|
|
|
#4 | |
|
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 207
Karma: 64000
Join Date: May 2006
Location: Oslo, Norway
Device: Sony PRS-650
|
Quote:
Code:
{#pages:'first_non_empty(
cmp($, 10, 'Tiny', '', '')
,cmp($, 25, 'Short', '', '')
,cmp($, 100, 'Medium', '', '')
,cmp($, 300, 'Long', 'Brick', 'Brick')
)'}
It works by successively comparing number of pages and selecting that value if the number is lower. I suppose you figure out how to change it to suit your preferences ![]() You can copy/paste the second to last cmp line if you want more values. |
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need help with programming a column based on previous data in the same column | seaquay | Library Management | 2 | 06-13-2012 12:19 PM |
| Automatically set custom column when fetching news | bork | Library Management | 1 | 04-14-2012 03:20 AM |
| How to automatically populate a tag with the decade from the pubdate via python | smoothrolla | Library Management | 5 | 11-19-2011 06:41 AM |
| Automatically add tag if word/phrase found in ebook? | eosrose | Calibre | 3 | 11-16-2011 06:48 AM |
| Automatically change titles to contain series info? | HunterZ | Calibre | 8 | 08-15-2010 09:02 PM |