Can someone help me with a problem which has been bugging me for years. I have asked all over the web for advice, including Apple obvs, but nobody has come back with a solution. Some people behave like bots and answer a different question which has no bearing on the issue at hand. It concerns (Apple) Books.
For reasons which cannot be explained, Books decided that it was going to hoover up all the PDF files on my iMac, despite Preview always being set as the default app for opening PDF files. This was the case on my 2015 iMac and now the same thing has happened to my other 2020 iMac.
Today I opened Books on my iPhone and the library was engulfed in PDFs, overwhelming the books, which became a few needles in a huge haystack. There are thousands of PDF files on the iMac and it looks like they have populated both iMacs and the iPhone. I donât know if they are somewhere else too, apart from their Finder location. I do not have enough years left to edit these files individually.
Someone said that I could delete my Books library and it would leave the files in their original position in the iMac, which sounds ideal but there are too many reports of the files being deleted âeverywhereâ to make me feel comfortable about this; I need all those PDFs for my work.
In Users/Library/Containers there are two folders called Books and two folders called Books Thumbnails. I do not know if this is right but Iâm guessing maybe not. Though I see the difference internally, at the first level, is that one Books folder has a CloudKit folder and the other doesnât.
I need to know how to get ALL PDFs out of my Books library on all devices, without losing the original PDF files and without losing the small collection of book books and audiobooks in my Books library.
and
To know how to stop this from happening again.
I hope you donât mind me jumping in with a question unrelated to current topics but I am getting desperate. Any advice anyone here can give me which answers these two questions would be sooo welcome.
Sorry I canât help with a specific answer but my question would be how the PDFs arrived in Books in the first place. I have hundreds of PDFs on my machine yet Books has a total of eight - and Iâm sure I had to manually import them.
If you didnât need the PDFs in their original locations I guess you could search for them (Find Any File) and move them somewhere safe before dumping them from the Books App.
Personally Iâd be hesitant to fiddle with anything in the User/Library/Containers/Books folders for fear of terminally breaking the Books app. Who knows what/how Apple sets them up - itâs weird enough having pairs of (seemingly) identically named folders.
Select a pdf file on the Mac and Get Info then set the default app and click on alwaysâŚthis should allow you to reset pdfs to be opened in Preview or Acrobat Reader or whatever you like.
I donât know if Books references the actual location of the pdfs itâs grabbed or if it copies it to itâs own libraryâŚbut deleting all of the unwanted pdfs from Books should not delete them from their original locationâŚbut I would check first to verify that it does not remove the original by first going to the original location and make a copy of some pdf elsewhereâŚthen going to Books and deleting it from there with the remove everywhere which will get it out of iCloud. Then go back to the original location and see if the pdf is still there.
At worstâŚyou can just drag and drop all of the pdfs from Books to wherever you want to store them then delete from Books.
Once youâve deleted all of the unwanted pdfs from Books it should sync with iCloud and theyâll disappear from other devices.
Thanks Neil. The PDF default is and has always been Preview, so I have no idea what allows Books to bypass this. I will certainly check that the original is not deleted by running a test as you suggest and I may run a safe boot too before reaching a conclusion. The big problem is needing to delete in large batches. Otherwise I will be at this for weeks and I can foresee me getting to the end of it, only for Books to do it to me again.
Thanks for this information. Unfortunately I could not find Mobile Documents on that path. A pity as, if that is where the documents reside, I wonder if I could delete them all from this location in big lumps. The Terminal link did show me the list of titles but thereâs no way to manipulate them.
You should be able to do this using the Books app on your Mac. First, confirm that the PDFs in Books are not the only copies of the PDFs you wish to keep. They should be in their original homes on the Mac so that the versions in Books are only copies. Assuming youâve done that, click the PDFs sidebar item in the Books app in the Library section. That should show all the PDFs in Books. Tap the circled ellipsis (âŚ) in the upper right corner of the Books window and select how you want to display the PDF collection. Select a small number of PDFs (20 or so). Now control-click and select the Remove⌠option. Select âDelete everywhereâ, and they will be removed from Books. If those operations went quickly, choose a larger group and repeat. Keep doing so until you have deleted your PDFs from Books.
This was a drastic method. You can modify it by creating a new collection of âPDFs to Saveâ and one of âPDFs to Delete,â adding PDFs to those collections, and deleting from the PDFs to Delete collection. Note that Collections in Books work much like Albums in Photos and Playlists in Music. Items can be members of several Collections; removing an item from a collection does not delete it, deleting an item removes it from everywhere, and removing a download does not remove it from iCloud but only from the Mac.
Finally, figure out why PDFs are automatically shared with Books when opened. On my Mac, I can share a PDF opened in Preview to Books, but I must do that explicitly.
I was unable to delete more than one PDF at a time but I did not know to use Option when removing a batch of PDFs. As it is, the Terminal script which Paal sent allowed me to just grab all of the PDFs and drag them ( about 6k files / 4.4 GB) to a holding pen on my desktop and Books is now back to books and audiobooks which is great. I am so grateful for everyoneâs help. Thank you.
If you double click on a pdf and it opens Books and runs the importâŚsomething is amiss. I would get a copy of Onyx for whatever version of macOS youâre running and execute itâs cleanup routinesâŚsounds like something is hosed in the LaunchServices or some other database that it will clear.
I think in recent versions of macOS Books stores epub and ibooks files in ~/Library/Containers/com.apple.BKAgentService/Data/Documents/iBooks/Books.
Thereâs a separate folder inside this, Audiobooks, for audio books, in which each has a subfolder named with some complex hash.
Thatâs where I find mine. I am not sure about PDF files though, because I have not imported any into Books. A very good thing that it does not auto-import PDF files though (!) because I have over 37K PDF files on my Mac.
I wonder if sometime in the past, the PDF files in question were imported into Books, and then more recently synch to iCloud was turned on so that both old and new Macs now see the same set?
It syncs to iCloud Drive/Books on my Sonoma laptop so if youâre syncing through iCloud that might be the real location. I donât have that folder in /Library or in ~/Library eitherâŚ
I dunnoâŚthat folder on my laptop only has 20something files in it all with strange names of numberstring.epub. The folder on iCloud Drive named BooksâŚwhich strangely enough opens just fine with the terminal link given before but if I open iCloud Drive Books isnât a visible folderâŚanyways that folder has 170ish files in it including the photography book updates I added to Books in the last week or so. My guess is that somewhere along the line if one is using iCloud to sync Books it got moved to the latter location.
For those that are interested, there are a few folders that you can see in normal way via Finder in Your User/Library/Mobile\ Documents/. On my mac these: