Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 10-29-2023, 01:50 PM   #961
strolego
Junior Member
strolego began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Oct 2023
Device: kindle PW signature edition
Hi
I'd like transfer my book on my new kindle with the following structure
Library/Author/Title
but I'm not able to obtain "Library" automatically
I'm trying to create a column with the name of the library, maybe using the function current_library_name(), but I always obtain an empty field.
Any suggestion
Thank you in advance
strolego is offline   Reply With Quote
Old 10-29-2023, 02:30 PM   #962
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: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by strolego View Post
Hi
I'd like transfer my book on my new kindle with the following structure
Library/Author/Title
but I'm not able to obtain "Library" automatically
I'm trying to create a column with the name of the library, maybe using the function current_library_name(), but I always obtain an empty field.
Any suggestion
Thank you in advance
What templates have you tried?
chaley is offline   Reply With Quote
Advert
Old 10-29-2023, 06:01 PM   #963
strolego
Junior Member
strolego began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Oct 2023
Device: kindle PW signature edition
Quote:
Originally Posted by chaley View Post
What templates have you tried?
I've tried
New Column -> Biblioteca (i.e. Library in italian)
Default Value -> {program:current_library_name()}

I've also tried with {program:'current_library_name()'}
but without success
strolego is offline   Reply With Quote
Old 10-29-2023, 06:17 PM   #964
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: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by strolego View Post
I've tried
New Column -> Biblioteca (i.e. Library in italian)
Default Value -> {program:current_library_name()}

I've also tried with {program:'current_library_name()'}
but without success
I see two problems:
  1. Default values can't be templates. Templates are used only in "Columns built from other columns" and not as default values.
  2. General Program Mode templates don't use {} characters. Use
    Code:
    program:current_library_name()
    Alternatively use Template Program Mode (TPM). Something like this:
    Code:
    {:'current_library_name()'}
    If you wish you could use this TPM template in the save template:
    Code:
    {:'current_library_name()'}/{authors}/{title}
chaley is offline   Reply With Quote
Old 10-29-2023, 06:33 PM   #965
strolego
Junior Member
strolego began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Oct 2023
Device: kindle PW signature edition
Quote:
Originally Posted by chaley View Post
I see two problems:
  1. Default values can't be templates. Templates are used only in "Columns built from other columns" and not as default values.
  2. General Program Mode templates don't use {} characters. Use
    Code:
    program:current_library_name()
    Alternatively use Template Program Mode (TPM). Something like this:
    Code:
    {:'current_library_name()'}
    If you wish you could use this TPM template in the save template:
    Code:
    {:'current_library_name()'}/{authors}/{title}
Thank you! It works perfectly
strolego is offline   Reply With Quote
Advert
Old 11-05-2023, 02:52 PM   #966
dunhill
Guru
dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.
 
dunhill's Avatar
 
Posts: 723
Karma: 228142
Join Date: Sep 2017
Location: Argentina
Device: moon+ reader, kindle paperwhite
Quote:
Originally Posted by chaley View Post
Assuming you are running calibre 6.12 or later:
Code:
{#kobo_percent_read:'switch_if($ >= 100, 'finished', $ <= 0, 'unread', 'reading')'}
And what would it be like if I used the status column and in the percentage column I put 100 if the status said Read?

Example:
I have my status column to rate the status of the book (read, to be read, reading)
And since I do not synchronize the reader process, I would like if the status of the book is Read, in the process column it would put 100
dunhill is offline   Reply With Quote
Old 11-05-2023, 05:13 PM   #967
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: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by dunhill View Post
And what would it be like if I used the status column and in the percentage column I put 100 if the status said Read?

Example:
I have my status column to rate the status of the book (read, to be read, reading)
And since I do not synchronize the reader process, I would like if the status of the book is Read, in the process column it would put 100
I don't understand. What is the process column type? What is the status column type? Where does the result of the template go? What are the exact computation rules?
chaley is offline   Reply With Quote
Old 11-05-2023, 09:07 PM   #968
dunhill
Guru
dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.
 
dunhill's Avatar
 
Posts: 723
Karma: 228142
Join Date: Sep 2017
Location: Argentina
Device: moon+ reader, kindle paperwhite
Quote:
Originally Posted by chaley View Post
I don't understand. What is the process column type? What is the status column type? Where does the result of the template go? What are the exact computation rules?
My status column is linked to goodreads and is updated with the goodreads sync plugin
What I am looking for is that if in that custom column that I have called #goodreadstags it says "Read" in another column where the reading process should appear, it tells me 100
The template should be in the custom column that depends on the result of #goodreadstags

I have tried
{#goodreadstags:'switch_if($ = 'Read', '100')'}
Attached Thumbnails
Click image for larger version

Name:	1.png
Views:	83
Size:	56.8 KB
ID:	204591  
dunhill is offline   Reply With Quote
Old 11-06-2023, 11:31 AM   #969
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: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by dunhill View Post
I have tried
{#goodreadstags:'switch_if($ = 'Read', '100')'}
Try this:
Code:
{#goodreadstags:'switch_if($ == 'Read', '100', '')'}
The comparison operator is ==, not =. The switch_if function requires a default that is used if there isn't a match. I added the empty string.
chaley is offline   Reply With Quote
Old 11-11-2023, 11:47 AM   #970
dunhill
Guru
dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.
 
dunhill's Avatar
 
Posts: 723
Karma: 228142
Join Date: Sep 2017
Location: Argentina
Device: moon+ reader, kindle paperwhite
Quote:
Originally Posted by chaley View Post
Try this:
Code:
{#goodreadstags:'switch_if($ == 'Read', '100', '')'}
The comparison operator is ==, not =. The switch_if function requires a default that is used if there isn't a match. I added the empty string.
That worked, thanks Chaley!
dunhill is offline   Reply With Quote
Old 12-04-2023, 04:05 PM   #971
BruDeV
Junior Member
BruDeV began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Nov 2019
Location: southern California
Device: Kindle Fire, Android tablet, PC
Windows filename aliases

Code:
program:
# windows filename aliases

	windows_alias_000 = titlecase(uppercase(field('title')));

# less-than sign -> left arrowhead \u02c2
	windows_alias_010 = re(windows_alias_000, "<", "˂" );
# greater-than sign -> right arrowhead \u02c3
	windows_alias_020 = re(windows_alias_010, ">", "˃" );
# colon -> modifier colon \uA789
	windows_alias_030 = re(windows_alias_020, ":", "꞉" );
# quote marks, -> single quote \u0027
	windows_alias_040 = re(windows_alias_030, "(\"|‘|’|‚|‛|“|”|„|‟)", "'" );
# solidus, division slash, fraction slash -> big solidus \u29f8
	windows_alias_050 = re(windows_alias_040, "(/|∕|⁄)", "⧸" );
# reverse solidus -> big reverse solidus \u29f9
	windows_alias_060 = re(windows_alias_050, "\u005c", "⧹" );
# vertical line -> broken bar \u00a6
	windows_alias_070 = re(windows_alias_060, "\|", "¦" );
# question mark -> Devanagan glottal stop \u097d
	windows_alias_080 = re(windows_alias_070, "\?", "ॽ" );
# asterisk -> flower puncuation mark \u2055
	windows_alias_090 = re(windows_alias_080, "\*", "⁕" );
# period, raised dot, two dot leader, one dot leader -> stenographic full stop \u2e3c
	windows_alias_100 = re(windows_alias_090, "(\.|⸳|‥|․)", "⸼" );
	
# extra stuff

# change multiple stenographic full stops to -> elipsis \u2026
	windows_alias_110 = re(windows_alias_100, "(⸼⸼⸼|⸼ ⸼ ⸼)", "…" );
# change versus
	windows_alias_120 = re(windows_alias_110, "\bversus\b", "vs" );
	windows_alias_130 = re(windows_alias_210, " vs: ", " vs " );
# change figure dash, en dash, em dash to -> hyphen-minus
	windows_alias_140 = re(windows_alias_220, "(‒|–|—)", " - " );
	windows_alias_150 = re(windows_alias_230, "--", "-" );
	windows_alias_160 = re(windows_alias_240, "- - -", " - " );

# add space after 'modifier colon' or 'stenographic full stop'
	windows_alias_200 = re(windows_alias_160, "(꞉|⸼\D)(\w)", "\1 \2" );

# remove extra spaces	
	windows_alias_900 = re(windows_alias_200, "( {2,})", " " );
	windows_alias_910 = re(windows_alias_900, "^( )(.*)", "\2" );
	windows_alias_920 = re(windows_alias_910, "(.*)( )$", "\1" );

Last edited by chaley; 12-04-2023 at 04:28 PM. Reason: Put template in [code] tags
BruDeV is offline   Reply With Quote
Old 12-04-2023, 04:57 PM   #972
BruDeV
Junior Member
BruDeV began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Nov 2019
Location: southern California
Device: Kindle Fire, Android tablet, PC
other possiblities

Code:
# question mark ➤ possibilities: \u0241 "Ɂ", \0242 "ɂ", \u02a1 "ʡ", \u0294 "ʔ", \u03c0 "ˀ"

# asterisk ➤ modifier letter cross acsent \u02df
	windows_alias_090 = re(windows_alias_080, "\*", "˟" );
BruDeV is offline   Reply With Quote
Old 04-20-2024, 11:01 AM   #973
Protoplast26
Member
Protoplast26 began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Jul 2021
Device: Kindle 10th gen and Kobo Aura H2O
I would like to create something like this

Quote:
Filename: Create file paths grouping authors into [A - D]-like categories (WinCE/Mobile (Mobipocket)) (Sweetpea)
Spoiler:
{author_sort:switch(^[A-D],[A - D],^[E-J],[E - J],^[K-O],[K - O],^[P-T],[P - T],^[U-Z],[U - Z],[Other])}
but i would like a file path for each letter to be stored in a separate folder, is it possible?
Protoplast26 is offline   Reply With Quote
Old 04-20-2024, 12:34 PM   #974
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: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Protoplast26 View Post
I would like to create something like this but i would like a file path for each letter to be stored in a separate folder, is it possible?
The Formatting subsection of the Advanced Formatting section in Template Language manual has examples that get close to what I think you want. The example is
Quote:
If you want only the first two letters of the data, use:
{author_sort:.2} - Only the first two letters of the author sort name
You would use
Code:
{author_sort:.1}
to get the first character.
chaley is offline   Reply With Quote
Old 04-21-2024, 11:11 AM   #975
Protoplast26
Member
Protoplast26 began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Jul 2021
Device: Kindle 10th gen and Kobo Aura H2O
Quote:
Originally Posted by chaley View Post
The Formatting subsection of the Advanced Formatting section in Template Language manual has examples that get close to what I think you want. The example is

You would use
Code:
{author_sort:.1}
to get the first character.
thanks
Protoplast26 is offline   Reply With Quote
Reply

Tags
custom column, tag, tags


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
custom column i need a little help shinken Calibre 3 09-15-2010 03:41 AM
Using Custom Metadata in Save Template EJvdH Calibre 1 07-02-2010 06:06 AM
Accessories Decalgirl Kindle 2 custom skin template srmalloy Amazon Kindle 6 04-09-2010 09:55 PM
Donations for Custom Recipes ddavtian Calibre 5 01-23-2010 04:54 PM
Help understanding custom recipes andersent Calibre 0 12-17-2009 02:37 PM


All times are GMT -4. The time now is 03:34 PM.


MobileRead.com is a privately owned, operated and funded community.