![]() |
#1 |
Member
![]() Posts: 14
Karma: 10
Join Date: Apr 2022
Device: MacBook Pro (2019)
|
[MacOS] Renaming output files
I tried using Save to Disk and all the saved files still truncate. And not by just a few characters but by several lines that macOS allows me to add manually to the filename. Is there a setting that is causing it to truncate?
The “Automatically convert added books...” option in “Add Books” -> "Control the adding of books" -> "Adding actions" works so well that it's a shame not to be able to use this and also be able to control the filename output. |
![]() |
![]() |
![]() |
#2 | ||
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,731
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
Quote:
|
||
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Member
![]() Posts: 14
Karma: 10
Join Date: Apr 2022
Device: MacBook Pro (2019)
|
Thanks, but I don't see anything about filename truncation. The default naming template is sufficient but I don't see anything in the prefs or the manual about how to save the complete title & author names without truncating them.
|
![]() |
![]() |
![]() |
#4 |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,731
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
It would help of you posted some screen shots as evidence of your claims that save to disk truncates your file names.
The Save to disk template defines how to construct save to disk paths and file names from the metadata. Example - in the following screenshot you see a Russian version of Tolstoy's War and Peace in my Test library and the contents of the library book folder - note the transformation of the title and author names from Cyrillic into Latin-1. These are my Save to disk preferences: When I do a Save to disk this is what I get in my Saved Books folder : Unfortunately I don't have an example of a truncated library file name - they a usually caused by subtitles, straplines, series names etc concatenated with the title in the title column. BR |
![]() |
![]() |
![]() |
#5 |
Member
![]() Posts: 14
Karma: 10
Join Date: Apr 2022
Device: MacBook Pro (2019)
|
Sure, I can post screenshots. Many of the ones that truncate actually do have the series name in the title in parenthesis. I didn't know this was a factor. But if I remove the parenthesis in Calibre and paste in more text it still cuts off the names of files and folders when saving to disk.
Here’s an example book title: “Enemy of the People: The Untold Story of the Journalists Who Opposed Hitler” by Terrence Petty. This is how it saves using the default “Save to Disk” template in Preferences w/ the latest Calibre 5.40 for macOS. In the 2nd image all folder/file names are truncated in the middle for some reason, even with the author folder which isn’t due to potentially having too many characters: |
![]() |
![]() |
Advert | |
|
![]() |
#6 | |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,731
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
FWIW I would put the subtitle into a separate custom column as shown in the attached screen shots. The replacement of the ':' with '_' is because Windows does not allow < > : " / \ | ? * in file names. I am going to put your issue in to its own thread and mark it as MacOS. BR Last edited by BetterRed; 04-09-2022 at 08:15 PM. Reason: Fix 5th image |
|
![]() |
![]() |
![]() |
#7 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,359
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Filenames have limited size. Dont try to shoehorn unlimited data into them.
|
![]() |
![]() |
![]() |
#8 | |
Member
![]() Posts: 14
Karma: 10
Join Date: Apr 2022
Device: MacBook Pro (2019)
|
Quote:
@kovidgoyal: But why are they being cut off in the middle, and why would the author's name also be truncated in the folder name as "Petty,rrence"? I also explained that on Mac I can type in extra lines of text (dozens of additional characters), so the filename allowed by the OS is not the limitation. |
|
![]() |
![]() |
![]() |
#9 |
Member
![]() Posts: 14
Karma: 10
Join Date: Apr 2022
Device: MacBook Pro (2019)
|
The name cutting off as "Petty,rrence" looks buggy. Does a complete author name really qualify as unlimited data or were you referring to something else?
|
![]() |
![]() |
![]() |
#10 | |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,731
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
And what is the path into which you are saving the books, try saving to a folder that's not deep in the file system hierarchy - e.g I am saving to: Code:
C:\Users\<--my name-->\Desktop\Saved Books
BR |
|
![]() |
![]() |
![]() |
#11 | |
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 46,243
Karma: 168983734
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Quote:
With Montery 12.3.1, here's what the OS reports as the limits: Code:
davidb@Davids-VMMac ~ % getconf NAME_MAX / 255 davidb@Davids-VMMac ~ % getconf PATH_MAX / 1024 Code:
/Users/davidb/calibre/Calibre Library/ Code:
/Users/davidb/calibre/Calibre Library/Petty,rrence/Enemy of the People: The Untold Stthe Journalists Who Opposed Hitler/Enemy of the People_ The Untold Story of the Journalists Who Opposed Hitler - Terrence Petty.kfx Personally, I place subtitles into a column just for them and only use the first entry in the author(s) and author sort to keep lengths shorter. The author bits are more intended for anthologies where you can have multiple authors and path lengths rapidly get out of control. Since I use mostly Kobo eReaders, I can send subtitle, series & multiple authors without needing to store them in the filename. As Kovid said, try to keep filenames short. Write your book in the file and not in the filename. Last edited by DNSB; 04-10-2022 at 01:03 AM. |
|
![]() |
![]() |
![]() |
#12 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
You can control where/how truncation happens using the built-in template function shorten(val, left chars, middle text, right chars).
The function documentation is: Quote:
You can also choose to use only the first author, not all of them. For example, this template uses the first 30 characters of the first author's name and the first 120 characters of the title, separated by a dash. Code:
{authors:'shorten(sublist($, 0, 1, '&'), 30, '', 0)'} - {title:shorten(120,,0)} Code:
program: res = ''; sep = ''; for a in sublist($authors, 0, 4, '&') separator '&': res = res & sep & shorten(a, 15, '', 0); sep = ' & ' rof; res & ' - ' & shorten($title, 100, '', 0) |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Renaming output files | jay2thagd | Library Management | 3 | 02-05-2021 08:41 AM |
Renaming files | jay2thagd | Introduce Yourself | 1 | 02-04-2021 07:44 PM |
Renaming files | victormpalma | Library Management | 1 | 07-14-2020 09:55 AM |
Problems renaming files | skoobwoman | iRex | 0 | 08-20-2008 01:03 PM |
Renaming files | col | Sony Reader | 29 | 06-29-2007 10:10 AM |