View Single Post
Old 09-10-2012, 11:54 AM   #4
Man Eating Duck
Addict
Man Eating Duck juggles neatly with hedgehogs.Man Eating Duck juggles neatly with hedgehogs.Man Eating Duck juggles neatly with hedgehogs.Man Eating Duck juggles neatly with hedgehogs.Man Eating Duck juggles neatly with hedgehogs.Man Eating Duck juggles neatly with hedgehogs.Man Eating Duck juggles neatly with hedgehogs.Man Eating Duck juggles neatly with hedgehogs.Man Eating Duck juggles neatly with hedgehogs.Man Eating Duck juggles neatly with hedgehogs.Man Eating Duck juggles neatly with hedgehogs.
 
Posts: 254
Karma: 69786
Join Date: May 2006
Location: Oslo, Norway
Device: Kobo Aura, Sony PRS-650
Quote:
Originally Posted by unboggling View Post
The one there is for Title length alone though. I'm ignorant about template functions - maybe someone else can help you total similar template for author with the one for title all in one template.
This one should do it:
Code:
program:format_number(add(add(strlen(field('title')),strlen(field('author_sort'))),0), '{0:d}')
You can replace the 0 with some integer because the path includes id and some padding.

I thought that Calibre automatically restricted total path length on windows, cropping as necessary? If this is a problem for you, you could also use something like vSubst (untested by me) from this page to make a "shortcut" to a folder disguised as a drive letter, and point Calibre to that instead.
Man Eating Duck is offline   Reply With Quote