Red Sweater Blog https://red-sweater.com/blog Official blog of Red Sweater Software Thu, 05 Sep 2019 22:22:49 +0000 en-US hourly 1 https://wordpress.org/?v=5.2.3 App Movement Monitoring https://red-sweater.com/blog/3508/app-movement-monitoring https://red-sweater.com/blog/3508/app-movement-monitoring#respond Thu, 05 Sep 2019 16:14:44 +0000 https://red-sweater.com/blog/?p=3508 I’ve been helping out when I can with the NetNewsWire open source project. Recently, Brent shared one of only a couple crash reports he’s received, in which the only plausible explanation would be if the app’s own internal files had failed to load. I recognized the likely cause of the problem immediately, because …

The Problem

Essentially, when a Mac app is launched, the location of that app on disk is saved, and used repeatedly whenever an internal component needs to located. The dynamic nature of resource loading in Mac apps means that these components are not typically loaded until they are need. For example, if you never show the Preferences window in a typical Mac app, the resources that define that window will never be loaded.

If, on the other hand, you decide to show the Preferences window, but you’ve moved the app since it was launched, things have a tendency to go haywire. The app will go searching for its Preferences resources in the location on disk where they used to be, and it won’t find anything. In the best case, the Preferences window simply fails to show. In the worst case? Assumptions about the infallibility of loading resources are proven wrong, and the app may crash.

A Solution

For many years, I’ve had an open ticket in my bug tracking system to address this same problem in my own apps. It’s not a completely critical problem, in part because it affects only a small subset of users, and only at the critical time when they have just moved or renamed an app. But the larger one’s user base is, the more examples of these hard-to-reason crash reports there will be. For a developer who is diligent about addressing defects in application code, these crash reports are both a distraction and a real concern.

Talking with my friend Paul Kafasis of Rogue Amoeba, he confirmed that they had also seen such issues over the years, and had already implemented a solution. He shared their pertinent source code with me, and has since shared it publicly on their company blog.

The Rogue Amoeba solution, in a nutshell:

  1. Watch the location of the app on disk.
  2. Prompt the user if it moves, offering a choice to quit or proceed with caution.
  3. Quit the app after confirmation by the user.

Given a head start by their code, I decided to finally tackle this problem in my own apps, and in NetNewsWire. What the heck? If I’m going to all the trouble, why not develop something so correct, and so dead simple to add, that it would be a no-brainer for other Mac developers to drop in a ready-made solution? It’s available on GitHub:

RSAppMovementMonitor: Gracefully handling the movement of a running app.

As I dug into the problem, I noticed a few areas where I thought I might deviate from Rogue Amoeba’s example. Their solution is tailor-made to the needs of their own apps, but as I thought about the problem in terms of my own apps, and in terms of the typical needs of most apps, I decided to make some changes. Roughly in order of what I perceive highest to lowest priority:

  1. The solution should be implemented in Swift, completely self-contained, and easy to drop in to any Mac app.
  2. The app should offer to relaunch instead of just quitting. This took a little extra work to keep track of both the original and final locations of the app on disk. Luckily my friend Rich Siegel of Bare Bones had good advice for me there.
  3. Relaunching should not be presented as an option, but as a necessity. In some data-critical apps, there may be cause to allow the user to keep the app running. I suspect this is the case for Rogue Amoeba’s apps, which are often doing live audio processing. In most apps however, particularly those without documents or that employ macOS autosave technologies, quitting and restarting the app is a safe operation.
  4. Localized strings should be cached at launch time. Because the prompt to the user will be presented after the app has moved, the localized resources that constitute that panel would not be available by the time they are needed. My solution loads and caches the localized strings so they’re ready if needed.
  5. Monitoring should be more aggressive. Watching for changes on the app bundle itself catches most of the user actions that lead to an app’s location changing on disk, but it misses scenarios such as when the user has renamed a folder containing the app. My solution checks whenever the app becomes active, on the assumption that the user will have made the app inactive before doing something such as renaming a folder in the Finder.
  6. The solution should be extensible through a custom handler, such that apps with differing needs can take advantage of the monitoring functionality, but act differently in response.

I think RSAppMovementMonitor serves the above priorities well, but ideally, none of this would be necessary. If only somebody were in a position to solve it even more elegantly…

Better Solutions

Apple itself could, and probably should, do more to alleviate the impact of this issue. What’s frustrating is they obviously acknowledge the problem, but have thus far done little do help. If you attempt to move a running application to the trash, you are met with a stern dialog forbidding the action. But if you attempt to rename an app, you are met merely with a warning. Finally, if you drag an app from one location to another, the Mac does nothing at all the impede you.

On a high level, there are two tacks Apple could take in addressing this:

  1. Prevent the movement or renaming of running apps.
  2. Mitigate the impact of moving a running app.

The former is probably a more pragmatic solution, along the lines of what I’ve shared here but with more reliable, and unified impact across all running apps on the system. The latter would require some kind of systematic change in the frameworks with respect to the way application resources are located and loaded at runtime. I can imagine a lot of solutions here but they may frankly be too much to bother with trying to patch on to the existing system.

MacOS 10.15 is, by all accounts, nearing completion, and there is no sign of a change in the status quo. So I suppose we can look forward to 10.16 and hope for some improvement at the system level. In the mean time, I hope that RSAppMovementMonitor proves useful either as a drop-in solution, or as an inspiration for more specialized handling of this situation in other Mac apps.

]]>
https://red-sweater.com/blog/3508/app-movement-monitoring/feed 0
NetNewsWire 5.0 https://red-sweater.com/blog/3506/netnewswire-5-0 Mon, 26 Aug 2019 18:49:43 +0000 https://red-sweater.com/blog/?p=3506 Today, Brent Simmons announced the launch of NetNewsWire 5.0. Congratulations to Brent and the rest of the open source team that made this happen!

NetNewsWire is an important app to me both because I have been actively using it as my news reader for over 15 years, and because it is literally the progenitor of MarsEdit! MarsEdit began as an in-app blogging feature before Brent spun it out into its own app

Recently on Twitter, Becky Hansmeyer observed that MarsEdit and NetNewsWire’s icons appeared to be related:

In fact, they are part of some “indie blogging software suite,” as informal as it may be. And MarsEdit has been getting lonely in this suite! After a long hiatus, it’s great to see NetNewsWire being actively developed again, not only by its original author, but with the help of a bunch of fresh new minds who I’m sure will carry it forward for many major updates to come.

]]>
MarsEdit 4.3.4: Quick Fix for Formatting Macro Crash https://red-sweater.com/blog/3502/marsedit-4-3-4-quick-fix-for-formatting-macro-crash Sun, 25 Aug 2019 14:59:04 +0000 https://red-sweater.com/blog/?p=3502 MarsEdit 4.3.4 is now available at the MarsEdit home page and has been submitted to the Mac App Store.

This update addresses a bug that was introduced in 4.3.3, causing a crash when applying certain formatting macros.

If you enjoy MarsEdit, please consider writing a review or rating the app on the Mac App Store, spreading the word on Facebook or Twitter, and of course, writing about the app on your own blog! Thanks for your support.

]]>
MarsEdit 4.3.3: Bug Fixes & Accessibility Improvements https://red-sweater.com/blog/3496/marsedit-4-3-3-bug-fixes-accessibility-improvements Fri, 23 Aug 2019 17:44:21 +0000 https://red-sweater.com/blog/?p=3496 MarsEdit 4.3.3 is now available at the MarsEdit home page and on the Mac App Store.

This update includes a few bug fixes, minor cosmetic changes, and improvements to VoiceOver support.

Here’s the complete list of changes for this release:

  • Bug Fixes & Enhancements
    • Fix a bug where the cursor jumped to the beginning of document when undoing in Rich Rext
    • “Ask Text” formatting macro placeholders no longer default to the pasteboard contents
    • Fix a typo and rework wording of the new blog panel
    • Increase vertical spacing between items in the Categories list
  • Accessibility Improvements
    • Expand VoiceOver support in the “Add Blog” panel
    • Remove a superfluous column from the Categories table that showed up in VoiceOver
    • Improve VoiceOver announcement of the Preview Window when using default preview template

If you enjoy MarsEdit, please consider writing a review or rating the app on the Mac App Store, spreading the word on Facebook or Twitter, and of course, writing about the app on your own blog! Thanks for your support.

]]>
Stonewall Promotion Yields $850 Donation https://red-sweater.com/blog/3491/stonewall-promotion-yields-850-donation https://red-sweater.com/blog/3491/stonewall-promotion-yields-850-donation#comments Mon, 01 Jul 2019 20:53:43 +0000 https://red-sweater.com/blog/?p=3491 On Friday I announced a promotion to benefit The National Center for Transgender Equality. I put all of Red Sweater’s apps on sale for 50% off, and pledged to donate the full amount of payments made using the coupon to the charity.

I’m excited to share that when all was said and done, 40 people took advantage of the offer, yielding $843.89 in revenue. I rounded that figure up to $850, and just completed the donation a few minutes ago.

Thanks to everybody who participated and/or helped to spread the word!

]]>
https://red-sweater.com/blog/3491/stonewall-promotion-yields-850-donation/feed 1
Remembering Stonewall https://red-sweater.com/blog/3489/remembering-stonewall Sat, 29 Jun 2019 03:06:34 +0000 https://red-sweater.com/blog/?p=3489 This weekend marks an important anniversary in the history of the struggle for gay rights in the United States, and around the world. Fifty years ago, the Stonewall riots kicked off a movement that has increasingly liberated transgender, lesbian, gay, and other people who fall outside the heteronormative status quo that continues to prevail.

In honor of this moment, I’m offering an unusually steep 50% discount on all of my apps, with all profits going to charity. This offer is good now through Sunday. Use the coupon code “Stonewall” by following this link:

Red Sweater Store – Stonewall Discount

All of the proceeds from anything purchased with this coupon will be donated to The National Center for Transgender Equality. I chose this charity because I believe trans people are less protected than most groups that fall under the LGBTQ umbrella. In the spirit of Stonewall I think it’s appropriate to support this under-represented group.

I’ll cover the payment costs, so the full 50% of list price will be donated to the charity. I will turn off the coupon on Monday and tabulate the total revenues then before making the donation.

I hope you find some great software, and also appreciate the opportunity to support our trans friends and neighbors.

]]>
Early Catalina Updates https://red-sweater.com/blog/3486/early-catalina-updates Thu, 27 Jun 2019 13:19:52 +0000 https://red-sweater.com/blog/?p=3486 Apple was quick to release a public macOS 10.15 beta this year, so some of you may already be installing it to give it a spin. If you haven’t installed it yet, I strongly encourage you to be more cautious than usual.

This year’s update to macOS includes a large number of significant architectural changes that are likely to break compatibility with some of your apps. Notably, Apple has dramatically revised the filesystem in such a way that most backup solutions will need to be updated, and they have finally dropped support for older, 32-bit applications.

Luckily for Red Sweater customers, all of our apps are, as of today, compatible with Catalina 10.15. Beta macOS releases are a moving target, so I can’t vouch for them continuing to work perfectly. As always, there are risks to running beta software, and there are risks to running even production software on beta macOS releases. But for those you who are daring enough to proceed with caution, here is the status for each of our currently shipping apps:

MarsEdit and Black Ink

MarsEdit and Black Ink were ready to hit the ground running. As long as you’re running the latest version 4.3.2 of MarsEdit, and either Black Ink 1.7.11, or the much-improved Black Ink 2 beta, you should be in good shape.

FastScripts

FastScripts 2.7.8, available today, addresses a crashing bug that affects users who have Finder aliases of a certain vintage in their Scripts folder. The Apple frameworks for resolving these files has a bug in the 10.15 public beta, and FastScripts has now been updated to work around the problem.

FlexTime

FlexTime 1.4.1, also available today, addresses a bug that caused the app to crash at launch on 10.15.

Clarion

Clarion 2.2 is a slightly more substantial update. It addresses a crash-at-launch bug on the 10.15 public beta, and also introduces a few additional enhancements to the app:

  • Dark Mode support for macOS 10.14
  • Clarion now requires macOS 10.12 or greater
  • Add NSSupportsAutomaticGraphicsSwitching to Info.plist to avoid depending on high power GPU
  • Fix a crash when launching on an future version of macOS

The Mac App Store version of Clarion 2.2 is not yet approved but should be available soon.

Touché

Touché 1.1.4 has been updated to address a crash-on-launch bug on the 10.15 public beta.

Caveat

One change in 10.15 is that Apple now requires apps to be “notarized” in order to avoid the system flagging the app as being from an “unidentified developer.” I’m working on getting all of my apps notarized with Apple, but in the mean time if you download an app directly on the public beta, you may need to right-click it in the Finder, select “Open” and then agree to proceed with allowing the app to launch.

Anything Else?

If you run into any problems with Red Sweater apps, either related to 10.15 Catalina or not, please drop us a line!

]]>
Accessible Crosswords https://red-sweater.com/blog/3483/accessible-crosswords Fri, 14 Jun 2019 13:59:32 +0000 https://red-sweater.com/blog/?p=3483 Many years ago, I set out to make my Mac crossword app, Black Ink, accessible to VoiceOver users. I failed. The assistive technology on macOS at the time simply did not seem up to the task for mapping the complex, two-dimensional, nested hierarchy of a crossword puzzle into a form that could be meaningfully conveyed over VoiceOver.

Now, as I look forward to finishing up Black Ink 2.0, I am encouraged to give it another try. VoiceOver has improved dramatically and I am optimistic that I’ll be able to ship this major update of the app with features that make it accessible to all.

I can’t do this alone. I need to know how the ideal accessible crossword app would behave, and to know that, I need advice from experienced VoiceOver users. If you or somebody you know is a Mac VoiceOver user who would enjoy helping me design the accessible interface to Black Ink, please consider joining the Red Sweater Slack so we can collaborate on this:

Join the Red Sweater Slack Community

I have some vague ideas of how to accomplish this but I’m looking forward to hearing from folks who are keenly aware of just how such an app should behave. After you join the Slack, please join me in the #accessibility channel. Thanks!

]]>
Improving the WordPress API https://red-sweater.com/blog/3477/improving-the-wordpress-api Fri, 24 May 2019 21:45:07 +0000 https://red-sweater.com/blog/?p=3477 Some MarsEdit customers may have run across a problem where posts that were published as “Draft” posts to WordPress end up getting stuck with the original draft publish date as the actual publish date when the post is changed to Published.

I took on the task of identifying the source of this problem and fixing it in the open-source WordPress project. That was 7 months ago. Unfortunately, it hasn’t been integrated yet. Here’s my post about the situation:

Unloved Patches

MarsEdit’s functionality is often limited by the capabilities of the blogs to which it publishes. WordPress is unusual in that it is open source, so anybody can contribute improvements to the platform. If those improvements are never accepted, however, it may as well not be open source.

]]>
MarsEdit’s Secret Title Bar Preference https://red-sweater.com/blog/3474/marsedits-secret-title-bar-preference https://red-sweater.com/blog/3474/marsedits-secret-title-bar-preference#comments Thu, 23 May 2019 02:11:27 +0000 https://red-sweater.com/blog/?p=3474 Michael Tsai wrote today about the accessibility challenges presented by Mac toolbars that do not have text labels. These are an unfortunate consequence of opting for macOS’s “no titlebar” style appearance, which has become increasingly popular in recent years. As Michael points out, MarsEdit is among the apps that has embraced it. This is how it looks by default:

Screenshot of toolabr icons from MarsEdit with no text labels.

The good news, for folks who don’t prefer this style, is MarsEdit supports a “secret preference” to change back to the more traditional style with a title for the window, and with the option to show or hide text labels. If you’re comfortable setting defaults from the command line, you can run this from Terminal to enable the labels:

defaults write com.red-sweater.marsedit4 ShowMainWindowTitleBar YES

If you’d rather avoid the command line, MarsEdit should apply the setting for you if you click this link:

Show MarsEdit’s Main Window Titlebar

Now, quit and relaunch MarsEdit. If the toolbar icon labels are not visible, select View > Customize Toolbar from the menu bar, and select the option to show “Icon & Text”. Here’s how it looks:

Screenshot of MarsEdit's toolbar icons with labels.

And if you decide to switch back, this link should do the trick:

Hide MarsEdit’s Main Window Titlebar

Ideally Apple would fix this mode so that some kind of appropriate compromise could be made to support the streamlined title-bar-free mode, while also supporting the display of labels. I’m not holding my breath on that, though. Hopefully this workaround will give those of you who either prefer, or outright depend upon the labels for accessibility reasons, something to tide you over.

]]>
https://red-sweater.com/blog/3474/marsedits-secret-title-bar-preference/feed 1