Archive for November 15, 2023

Wednesday, November 15, 2023

Search Suggestion Menus in AppKit

John Brayton:

Even though Safari, Mail, and Finder implement search suggestion menus, there is no standard AppKit mechanism for providing them in AppKit. Popping up an NSMenu does not work because the search field cannot receive keystrokes while the menu is displayed.

Interestingly there is a good mechanism for providing search suggestion menus in SwiftUI, but incorporating that mechanism into an AppKit-based application looks much more difficult than just using an NSHostingView.

I ended up starting with a CustomMenus sample project. This 2018 project by Doug Stein is a Swift port of Apple Objective-C sample code from 2012.

Xcode 15 Logs nil As an Empty String

Jeff Johnson:

[The] functions os_log and NSLog now log nil as an empty string. The previous behavior, going back forever as far as I remember, was to log nil as (null).


I don’t know whether this is a bug or intended behavior, but it makes debugging our apps markedly worse, because now there’s no easy way to identify nil objects or to distinguish between nil and @"" in the log output.

This only affects logging within Xcode itself. Still not good, though.

Jeff Johnson:

I’ve now found three different bugs in the new Xcode 15 console.


Fortunately, I’ve found a way to restore the previous console behavior from Xcode 14 and earlier. This is actually noted in the Xcode 15 release notes, but I wanted to highlight the solution here in case, like me, you hadn’t read the release notes recently[…]


You need to set the environment variable IDELogRedirectionPolicy to the value oslogToStdio in the Run section of your app’s Xcode scheme. I wish there were a way to make this behavior the default in Xcode Settings!

Jeff Johnson:

Since then I’ve had some back and forth with Apple on that bug in Feedback Assistant. I’m going to screenshot the entire exchange below. For context, if you’re not familiar with Apple’s bug reporting system, they constantly ask developers to “Please verify this issue” with the latest betas, despite having done nothing to fix the issue in the latest betas, in the hope that the issue (or maybe the developer) will magically go away.


The ultimate outcome of this case was that Apple blatantly lied to me—“As you’ve indicated, this issue is resolved”—and then Apple refused to hear any contradiction to their lie—”this Feedback will no longer be monitored, and incoming messages will not be reviewed.” This kind of response reinforces what I said earlier in the exchange: “It makes me not want to file feedbacks at all. It feels like you don’t care.” The coup de grâce was “We appreciate your feedback.” No, Apple absolutely does not appreciate our feedback.

In this case, Apple considers it resolved because the problem doesn’t occur on Sonoma. But Xcode 15 is supposed to work on Ventura, and it should be fully functional there considering that Apple doesn’t support Xcode 14 on Sonoma.


Kindle for Mac 7.0

Filipe Espósito:

Amazon launched an official Kindle app for macOS more than eight years ago, allowing Mac users to download and read their ebooks from Amazon’s platform on their computer.


On Tuesday, the official Kindle app available on the Mac App Store was updated to version 1.40.2. But while the release notes mention that the new version brings “stability improvements and bug fixes,” we also noticed that the app has been renamed “Kindle Classic.”

Michael Kozlowski:

Amazon has just announced that they are discontinuing the current Kindle for Mac software, and it will be shuttered entirely sometime this October. It will be removed from the Mac Store completely. Amazon is replacing the current Kindle for Mac with an improved app, including an enhanced book reading and library management experience.


A new Mac app will be a welcome change; the current app looks dated and is very similar to Kindle for PC. The last Mac update was five months ago.

Michael Kozlowski:

The new app has a modern design that is similar to the Kindle app for iOS. You get new features such as infinity scroll, reading ruler, additional fonts, full screen view, new themes, page-turn animations, X-Ray and a ton of new changes. I find that the new Mac app finally brings the overall Kindle experience into 2023.

Kindle for Mac has the same design as the popular Kindle app for iOS. The default view is your library, with bright and bubbly cover art of all the ebooks that you own or samples that have been downloaded. You can sort by grid, lists or collections, and filter by read/unread, documents and Newsstand. There is no audiobook functionality in the Kindle app right now and no audiobook player. At the bottom of the screen are shortcuts to your library, cover art of the book you are reading and a more button. In the more section you can view notes that you have created with a Kindle Scribe, which is really useful. Here is where you can sync the Mac app, so you can fetch new purchases you have made on a Kindle e-reader, but you cannot buy books on Kindle for Mac.


It looks like an improvement, because cosmetically it looks more ‘modern’, but in reality it’s less functional and more frustrating to use than the old program. That’s mainly because it’s just a straight port from the iPad, so of course it’s less functional on MacOS. The main problem is the lack of keyboard features — there’s no way of getting at some features with the keyboard, and there’s no way of discovering the few shortcuts which have survived from the previous version. E.g. The old shortcut to get the notes panel services, but you can’t get to the contents panel with the keyboard; you can bring up the search panel with a shortcut, but once you’re there, you have to use the mouse to scroll through the list and so on.

Worse, some of the shortcuts that do survive (e.g. Left and right arrows) randomly stop working when you’re in one of the panels. It’s a complete mess and it’s clear that little if any thought has been put into fitting the app to the OS. (Actually, you get the same frustrating friction using the iPad app with an external keyboard, but at least there it’s a bit more understandable.)

Finally, it seems that the program has stopped catering for Mac URL links (kindle://) so programs like Hookmark can no longer link to locations.

Contrary to other comments in that thread, I found that the new Kindle app does run natively on Apple Silicon Macs. Kindle Classic required Rosetta.

While the old app was never a good Mac app, it was at least a desktop app. The new Kindle app uses Catalyst and looks and feels like a mobile app. You can only open one book at a time, and there are fewer zoom options. There’s no information-dense list view. You can’t filter the list of books. There’s no Settings menu command or window, only a screen in the main window hidden beyond the hamburger button. You can’t export annotations as a file, only share them via e-mail. Typing Command-F to start a search doesn’t put the insertion point in the (square) search field, so you have to click before you can type your query. It crashed first time I tried to search.


I was really hoping for a more sophisticated platform for library management beyond the archaic sorting of Categories only. […] I have over 8000 titles and to have only one option for classifying myriad genres is next to useless.

Amazon has no interest in helping you manage your library of e-books. It doesn’t even support the rudimentary Lists feature that the iOS and old Mac apps had, but which never worked reliably. They just do the bare minimum so that you can view the content that you purchase from them. Apple is pretty much the same these days. Yes, there’s legacy code from iTunes for managing a local music or video library, but the focus is on pushing content into a services window, not on giving you control over your media.


Update (2024-01-05): In my experience, sharing annotations via e-mail from the new Mac app doesn’t work. It says it sent the message (whose subject says it came from my iPad), but the recipient doesn’t receive it, and it doesn’t appear in my Sent mailbox. The Web version used to have good ways to export annotations but now can’t even display them—it only shows the first line of each highlight. The iPhone app is able to export an HTML file via e-mail. The Kindle itself can export CSV and PDF via e-mail. If you’ve highlighted more than the limit in the book, the best way is probably to use the new Mac app, open a large window, and take screenshots to OCR.