Thread: kindle folders
View Single Post
Old 05-11-2012, 07:01 AM   #5
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,449
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Dirk2718 View Post
I have a similar problem. I want to put some books in an additional folder. So I add a custom column with column type "Yes/No" and changed the Save Template to this, so that every book with a yes in the column "extradir" will be copied to the additional directory "DirName".
Code:
{extradir||DirName/}{author_sort}/{title} - {authors}
But this code doesn´t work. The books are still copied to {author_sort}/{title} - {authors}.
What did I make wrong?
Three problems:
1) The lookup name for a custom column must begin with the '#' character.
2) You left off the colon after the lookup name
3) You will get the values "YesDirName/" and "No". I assume you do not want the "Yes" or the "No" to be there.

The following in single function mode fixes all three problems.
Code:
{#extradir:test(DirName/,)}{author_sort}/{title} - {authors}
The following in template program mode is equivalent
Code:
{#mybool:'test($, 'DirName/', '')'}{author_sort}/{title} - {authors}
as is the following in general program mode.
Code:
program: strcat (test(field('#mybool'), 'DirName/', ''), template('{author_sort}/{title} - {authors}'))
chaley is offline   Reply With Quote