03-08-2024, 11:11 AM | #16 | |
want to learn what I want
Posts: 1,008
Karma: 6422750
Join Date: Sep 2020
Device: Calibre E-book viewer
|
Quote:
So exporting/ re-importing either as .sql or .csv won't work as well. I had also tried to copy the sql from the 'doc' column, manually editing the CSS bit on a text editor, and executing it, but I get a "finished with errors" message: Execution finished with errors. Result: unknown function: unixepoch() At line 1: INSERT INTO "main"."notes" ("doc") VALUES ('<div> <p><img src="calres://xxh64/4e2f0cd ..... Last edited by Comfy.n; 03-08-2024 at 11:19 AM. |
|
03-08-2024, 11:48 AM | #17 |
Grand Sorcerer
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
I can give you python templates that export and import every author note to some folder. You would run the templates in the template tester. You could also change them a bit to make them into Action Chains template code.
The folder name would be hard-coded in the template. I don't want to bother with opening a dialog. You would export the notes then do what you want. The filename for the note would be something like "lookup_key#@#escaped_item_value#@#item_value_in_h ex. The import template would process all the files in the folder, splitting the components apart. If the item value exists for the lookup key, it would import the note. It will be this weekend before I can write the templates. |
Advert | |
|
03-08-2024, 11:54 AM | #18 |
want to learn what I want
Posts: 1,008
Karma: 6422750
Join Date: Sep 2020
Device: Calibre E-book viewer
|
Sounds perfect, thanks chaley. I hope I get along well with the template tester
|
03-10-2024, 08:52 AM | #19 |
Grand Sorcerer
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
I decided to do these as Action Chains actions because that is easier to use. Not easier to write, unfortunately, but that is neither here not there.
The attached zip contains two actions, Export notes and Import notes. Export notes asks you for the folder where it is to put the notes, then the field name (such as "authors") where it is to get the notes to export. It writes all the notes for that field into the folder with the file name Code:
field_lookup_name#@#escaped_item_value#@#item_value_in_hex I've tested them but that doesn't mean they will work for you. Please make a backup of your library before trying them. If something doesn't work, let me know. I'm not particularly interested in messing with the user interface or otherwise making it "cosmetically better". Also, you will see that the HTML files include <head> ... </head> tags. Don't put anything in the head element because it is stripped away when the note is imported. If you want to style the note, do it with inline styles, in the head of the enclosing HTML document, or with <style> elements in the body. I haven't tried the last one but the 'net says it works in HTML5 browsers. Some say the browser might render the page twice, once without the styles and once with. Last edited by chaley; 03-10-2024 at 10:19 AM. |
03-10-2024, 10:14 AM | #20 |
want to learn what I want
Posts: 1,008
Karma: 6422750
Join Date: Sep 2020
Device: Calibre E-book viewer
|
Can't thank you enough, chaley. It works perfectly, both the export and the import.
Phew! I'm so glad I won't need to run again 1500+ author data retrieval again just to get the desired styling on the book details pane. |
Advert | |
|
03-10-2024, 10:31 AM | #21 |
Grand Sorcerer
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Thanks for confirming that it works for you.
I added post #19 above to the Action Chains Resources thread Last edited by chaley; 03-11-2024 at 02:39 PM. Reason: Fix broken cross-linking |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Bulk Tag Editing (Bulk-adding Prefixes for Heirarchical Tags) | Jackwc | Library Management | 3 | 01-14-2024 05:24 PM |
Bulk Editing Comments | ilovejedd | Library Management | 3 | 01-14-2018 07:23 PM |
Bulk metadata editing | paoletto | Library Management | 7 | 10-29-2014 12:42 PM |
Editing Metadata in Bulk | ballast | Calibre | 5 | 08-15-2010 03:14 PM |
Editing Metadata in Bulk Question | lwpack | Calibre | 10 | 07-19-2009 11:40 PM |