![]() |
#1 |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 37
Karma: 71294
Join Date: May 2016
Device: Sony DPT-RP1 and Pocketbook Touch Lux 2 and Basic
|
How to sync MacOs Finder Tags with Calibre Tags
Is there a possibility to sync Calibre Tags to MacOs Finder Tags? So that whenever I change the tags in Apples Finder the Calibre Tags get changed too?
![]() |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 44,274
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
no there isn't
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 37
Karma: 71294
Join Date: May 2016
Device: Sony DPT-RP1 and Pocketbook Touch Lux 2 and Basic
|
And do you know if there is a possibility of scripting adding one to the other? So Is there a possibility to add calibre tags by script within the finder? Could you modify for example the metadata.opf to add tags to calibre?
|
![]() |
![]() |
![]() |
#4 | |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 20,858
Karma: 27620684
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
To go the other way, you would export the tags into a similar CSV using the Create catalog feature and import it into MacOS, you may need to add the Create catalog feature to a toolbar or menu. I have no idea how to export the tags from the MacOS file system into a CSV file, not how to import a CSV into the MacOS file system. BR |
|
![]() |
![]() |
![]() |
#5 | |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 37
Karma: 71294
Join Date: May 2016
Device: Sony DPT-RP1 and Pocketbook Touch Lux 2 and Basic
|
Quote:
![]() |
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 44,274
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
If you want to script calibre, use calibredb which has an extensive interface to the calibre database, see https://manual.calibre-ebook.com/gen...calibredb.html
|
![]() |
![]() |
![]() |
#7 | |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 37
Karma: 71294
Join Date: May 2016
Device: Sony DPT-RP1 and Pocketbook Touch Lux 2 and Basic
|
Quote:
![]() Where I am struggling is getting the ID and use the ID with shell script. If I use that script, it works nicely: Code:
#!/bin/bash id=3149 a='-f "tags:Hegel"' eval calibredb set_metadata "$a" "$id" ![]() |
|
![]() |
![]() |
![]() |
#8 |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 20,858
Karma: 27620684
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
A calibredb list --fields id,authors,title command will provide a list of books in current library showing the book id, authors, and title columns as a comma separated list. Pipe it to a file and edit that to create the script.
BR |
![]() |
![]() |
![]() |
#9 |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 37
Karma: 71294
Join Date: May 2016
Device: Sony DPT-RP1 and Pocketbook Touch Lux 2 and Basic
|
Thank You – I will try that!
For the time being I found another solution: I used the folder containing the file. There the ID is in Brackets. So I can get the ID with the Code: Code:
i=$(echo "$1" | awk -F'[()]' '{print $2}') |
![]() |
![]() |
![]() |
#10 | |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 20,858
Karma: 27620684
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
![]() Now you have two ways to get what you want. BR |
|
![]() |
![]() |
![]() |
#11 |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 37
Karma: 71294
Join Date: May 2016
Device: Sony DPT-RP1 and Pocketbook Touch Lux 2 and Basic
|
Adding Tags from Finder to Books in Calibre via Hazel
So now a first solution (for now):
A short Tip for those of you who want to translate the Tags of the Finder (f.e. made by Hazel https://www.noodlesoft.com/forums/vi...hp?f=3&t=10822) to the Calibre library. Calibre stores its tags (and other metadata) in the metadata.db database file <del>next to the PDF, Epub or Mobi in the same directory</del> in the calibre library. To access the metadata of calibre you need the calibredb command line, the ID of the book, the Tag you want to add and a nice Program which is called Hazel to automate the process (maybe you can do that with a folder-script, but I am not sure). The ID is within the folder name containing the book file. So the folder is the one which we want to process with Hazel. In Hazel my setup is: ![]() What it does: it tells Hazel to process all folders which have a certain "Full Name" (because we want to include the folders with a "." in the name) that contains a file that has the tag "Hegel". So we want to add the tag with the Book-ID <del>to all of the metadata.opfs within such a folder we want to add the tag "Hegel"</del> to the metadata.db database in the library so that calibre recognizes those tags. As the ID needed by calibredb to add such a tag is within the name of the folder (in brackets), we can now extract the ID from the $1 (which Hazel gives the shell script: The File Hazel processes) and use it in the shell script: Code:
#!/bin/bash #tells $i to be the number in in brackets of the folder name i=$(echo "$1" | awk -F'[()]' '{print $2}') #tells $a to be the tag Hegel a='-f "tags:Hegel"' eval calibredb set_metadata "$a" "$i" fi Now: wherever I wrote "Hegel" you can add every tag you want (or multiple) to insert into calibre. You will need a rule in Hazel for every Tag you want to add –*so simply copy your Hazel rule and change the Tags. If you know of a better way or see any flaws or possible improvements of that Hazel rule, please write me! Last edited by BetterRed; 01-10-2019 at 03:49 PM. Reason: change metadat.opf to metadata.db - the difference is important because both exist |
![]() |
![]() |
![]() |
#12 | |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 20,858
Karma: 27620684
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
The metadata.opf files in the book folders, along with any metadata_db_prefs_backup.json file in the library folder, are the means to restore the metadata.db database should it become corrupt. BR |
|
![]() |
![]() |
![]() |
#13 |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 37
Karma: 71294
Join Date: May 2016
Device: Sony DPT-RP1 and Pocketbook Touch Lux 2 and Basic
|
Thanks for the calification! I did not know that!
|
![]() |
![]() |
![]() |
#14 | |
Enthusiast
![]() Posts: 27
Karma: 10
Join Date: Jan 2018
Device: none
|
I would need the exact opposite: I would like to set my tags in Calibre and mirror them in Mac OS, do you have any advice?
thanks! Quote:
|
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Embedding TAGS specifically on MacOS | ghoetker | Library Management | 1 | 12-04-2018 04:10 AM |
Sync Calibre Prefs between Win 10 and macOS Sierra | saluli | Library Management | 0 | 06-05-2017 08:33 PM |
Calibre Tags & Aldiko Tags Not the Same | Themus | Calibre | 3 | 03-21-2012 08:23 PM |
Amazon Tags - Popular tags vs Unique tags. | chrisanthropic | Writers' Corner | 6 | 09-19-2011 11:18 PM |
Sony Library Sync/Calibre/Tags? | JanieB | Calibre | 10 | 04-11-2010 12:44 AM |