• This does not look ideal. I reported it to the electric company.

    Fallen tree being held up by electrical wires
  • NSHappyHour meets tonight at Bit Bar in Salem MA at 6:30 PM. New folks are always welcome. Thanks to @whitedonkey@mastodon.social for organizing.

  • I failed at Wordle two days in a row. Not April Fools, unfortunately. 🤦‍♂️

  • Saving to Safari Reading List

    Unread lets a user save articles and links directly to Safari Reading List, without going through the share sheet. This is a popular feature, but there are unfortunate limitations on both iOS and macOS.

    iOS

    On iOS, SSReadingList lets an app save a webpage URL to Safari Reading List. This initially worked well. But in iOS 13.4 a confirmation dialog was added. Every time an app saves a webpage URL to Safari Reading List, the system displays an alert asking the user for permission.

    I assume this is intended to prevent rogue apps from filling a user’s Safari Reading List with junk. But there needs to be a way for a user to indicate that they trust an app to write to Safari Reading List without being prompted every time.

    I filed FB7573628 in February 2020 (over four years ago) requesting this.

    Honestly if the alert had existed when I first added the ability to save an article to Safari Reading List, I would not have added this functionality to Unread. The alerts are obnoxious.

    macOS

    SSReadingList is not available to macOS apps, but an Add to Safari Reading List Sharing Service can save a webpage URL to Safari Reading List. On macOS this has the side effect of Safari coming to the foreground. The user experience would be much better if Safari stayed in the background. I filed FB13682568 with a sample project requesting this.

    Apple could make the experience of saving to Safari Reading List from an app much better by addressing these issues. I hope that they will.

  • Sharing via Email on macOS

    On iOS Unread has a Mail Content article action. This lets customers quickly compose an email with the HTML content of an article. It uses MFMailComposeViewController. MFMailComposeViewController has the unfortunate limitation of only working with Apple Mail, but it is otherwise great. The Mail Content article action is popular with my customers.

    macOS has a Compose Email Sharing Service, making it easy for an app to ask the system to create an email message with a recipient, subject, and message body. I was excited to find that this service works with the user’s default email client. It is not limited to Apple Mail.

    The Compose Email Sharing Service can accept either a plain text string, or an attributed string with formatting and embedded images.

    But after spending more time working with the Compose Email Sharing Service, I was disappointed by some of its weaknesses.

    Bugs Around Embedded Images

    When sharing articles as rich text, I found that embedded images often get moved to the end of the article. I was able to generate a simple test case – an attributed string with an embedded image at the beginning of it. If I share that attributed string with the sharing service, Apple Mail will generate a message with the image moved to the end. I filed FB13668576 documenting this.

    Plain Text Messages

    If Apple Mail’s Message format setting (under the Composing pane of the Apple Mail settings window) is set to Plain Text, outgoing messages created using the sharing service are converted to plain text. All formatting and embedded images are lost. Arguably that is the correct behavior because it honors the user’s message format setting.

    However a bigger problem is that there is no spacing between paragraphs. The resulting message for a multi-paragraph article is a wall of text. If Unread had a way to determine whether Apple Mail’s message format setting was plain text, Unread could add its own blank lines between paragraphs. But since I cannot find a way to get that information from a sandboxed Mac app, I can either share an attributed string with formatting and embedded images or I can share a plain text string with my own Markdown-like formatting. I cannot do both.

    Third Party Email Apps

    When the user’s default email client is something other than Apple Mail and an app sends an attributed string, the email client just gets the plain text. The plain text version of the string will also lack basic plain text formatting such as blank lines between paragraphs.

    Scripting Apple Mail Directly

    I considered trying to send an Apple Event to Apple Mail, hoping that I could simply tell Apple Mail to create an outbound email message with specific HTML content. However the sdef for Apple Mail states that setting the html content attribute of an outgoing message has no effect. The setting is deprecated. My testing confirms that setting that attribute has no effect.

    Feedback Reports

    I filed these feedback reports

    • FB13668659: .composeEmail NSSharingService - Multiple paragraphs, Plain Text Message Format
    • FB13669961: Formatting lost when sharing multi-paragraph attributed strings to third party email clients via the .composeEmail NSSharingService
    • FB13668576: When creating an email using the .composeEmail NSSharingService using an attributedString, images are moved to the bottom of the message

    I find using NSWorkspace.shared.open(URL) with a mailto: URL instead of the Compose Email Sharing Service to be about twice as fast for sending plain text email.

  • The Supreme Court must really be backlogged if they cannot hear the presidential immunity case until the end of April. President Biden should appoint a few additional Supreme Court justices to give them the capacity they need.

  • Voting FTW.

    “I Voted Early” sticker
  • At this evening’s CocoaHeads Boston meeting on Zoom, Ed Arenberg will discuss his experiences developing on the Vision Pro and show his game “Connect3D - Spatial” running on-device. New folks and folks from outside the Boston area are always welcome.

  • NSHappyHour meets at Bit Bar in Salem MA tonight at 6:30. New participants are always welcome. Thanks to @whitedonkey@mastodon.social for organizing.

  • I am excited to see that Castro is in good hands again.

  • A 30-day streak.

    A screenshot showing that I walked at least 10,000 steps on each of the past 30 days.
  • NSHappyHour is at the Lobster Shanty in Salem, MA at 6:30 PM tonight. New folks are always welcome. Thanks to @whitedonkey@mastodon.social for organizing.

  • I made an early beta version of Unread for macOS available. Details at: www.goldenhillsoftware.com/2024/01/e…

    Unread is an RSS reader with beautiful typography, great handling of articles from summary-only feeds, and a variety of color themes.

  • I like @incanus@mastodon.social’s idea of Repurposing Hugo as a wiki.

    I have a bunch of loose markdown files in a version-controlled folder that I consider my “company wiki”. Making it navigable with a web browser and letting documents link to each other would be a significant improvement.

  • CocoaHeads Boston will meet Thursday evening via Zoom at 7:00 PM Boston time. New participants and participants from outside the Boston area are always welcome.

  • Congratulations to the winners and runners-up of MacStories Selects awards.

  • NSHappyHour meets at the Lobster Shanty in Salem, MA, at 6:30 tonight. New participants are always welcome. Thanks to @whitedonkey@mastodon.social for organizing.

  • A huge new feature for MarsEdit: Mastodon support. Congratulations to @danielpunkass.

    MarsEdit 5.1: Mastodon Support is Here!

  • Happy Thanksgiving!

    youtu.be/Q0UVPHbYo…

  • I am now posting to my blog, and automatically cross-posting to Mastodon. The best way to follow or reach me via Mastodon (or Mastodon-compatible) service is @johnbrayton@iosdev.space. You can also follow my posts via my blog and its RSS feed.

  • I just had a new furnace and water heater installed. The old furnace was 29 years old, the old water heater was 15 years old. I am ready for winter. (Or at least my house is.)

  • Search Suggestion Menus in AppKit

    I recently implemented a search suggestions menu on macOS for Unread.

    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.

    With that as a base, I updated it to support things like dark mode. I also made it a little more focused on search suggestion menus, as opposed to custom menus in general.

    The result is a sample project on GitHub. I hope you find it useful.

    Thank you to:

  • We have a great agenda for this evening’s CocoaHeads Boston meeting via Zoom. Conall McCabe will give a presentation pertaining to Core Motion, axes of device orientation, and associated data structures.

    www.meetup.com/cocoahead…

  • I helped my city perform a recount yesterday. It is fun to participate in the process.

subscribe via RSS