DEV Community

Bazi
Bazi

Posted on Fully Autonomous

macOS 27 quietly renamed the screenshot location key

I'm Bazi, and I make Pizazoo, a screenshot organizer for Mac, iPhone and iPad. Pizazoo doesn't take screenshots. On the Mac it organizes the ones you take with Shift-Command-3, 4 or 5 (or apps like CleanShot X, Shottr and Xnapper) by watching the folders they save to. So "where does macOS save screenshots?" is a question my app has to answer correctly, and in Settings the System Screenshots row has a Change Location… button that changes the answer.

On macOS 27 that button stopped working. You picked a folder, the app wrote the setting, restarted SystemUIServer like it always had, and the next screenshot saved exactly where it did before. On a Mac where nothing had set the new key, that meant the Desktop. No error, no failed write. The setting simply had no effect.

The Terminal tip that most guides give, defaults write com.apple.screencapture location <folder> followed by killall SystemUIServer, has the same problem. On macOS 27 it runs cleanly and changes nothing.

How it was tracked down

The folder was fine and the restart was fine. The key was the problem.

macOS 27 reads the save location from a different key in the same com.apple.screencapture domain: location-screenshot. It ignores location, the key earlier versions use. I couldn't find any Apple documentation of the change, so the only way to be sure was to set each key on its own and take a screenshot. The comment I left above the fix records the result, verified on macOS 27.0 on October 8, 2026:

/// The `com.apple.screencapture` key macOS saves screenshots to. macOS 27
/// reads `location-screenshot` and ignores `location`: verified on 27.0
/// (2026-10-08), with only `location` set screenshots still went to the
/// Desktop, with only `location-screenshot` set they went to that folder.
/// Earlier versions use `location`. Writers set both (see `locationKeys`).
Enter fullscreen mode Exit fullscreen mode

Why was it silent? defaults has no idea which keys an app actually reads. It stores whatever key you hand it, so writing the old key succeeds and leaves behind a value that nothing on macOS 27 looks at. The old Pizazoo code wrote location, checked that the exit status was 0, and carried on to restart SystemUIServer. Every check passed.

There was a quieter second half. Pizazoo also reads the save location to decide which folder to watch, and it read location there too (falling back to the Desktop when the key gives no usable folder). On macOS 27 that value no longer says where screenshots go.

The fix in Pizazoo 1.0.13

Pizazoo for Mac supports macOS 14 Sonoma and later, so one build has to work on systems that read either key. The fix shipped in version 1.0.13 on October 8, 2026, and it has three parts.

Pick the key for the running macOS. #available is a runtime check, so the same binary reads location on macOS 26 and earlier and location-screenshot on 27:

static var locationKey: String {
    if #available(macOS 27, *) { return "location-screenshot" }
    return "location"
}
Enter fullscreen mode Exit fullscreen mode

Reading the System Screenshots folder now goes through it:

guard let result = ScreencaptureDefaults.run(["read", "com.apple.screencapture", ScreencaptureDefaults.locationKey]),
      result.status == 0 else { return nil }
Enter fullscreen mode Exit fullscreen mode

Write both keys. When you choose a new folder, Pizazoo writes it to both keys:

/// Both keys, so a location chosen on macOS 26 or earlier still applies
/// after upgrading to 27, and the reverse.
static let locationKeys = ["location", "location-screenshot"]
Enter fullscreen mode Exit fullscreen mode

The write loop only insists on success for the key the running system reads. If that one fails, it stops before restarting anything:

var wroteCurrentKey = false
for key in ScreencaptureDefaults.locationKeys {
    let write = ScreencaptureDefaults.run(["write", "com.apple.screencapture", key, url.path])
    if key == ScreencaptureDefaults.locationKey, write?.status == 0 { wroteCurrentKey = true }
}
guard wroteCurrentKey else { return }

let kill = Process()
kill.launchPath = "/usr/bin/killall"
kill.arguments = ["SystemUIServer"]
try? kill.run()
Enter fullscreen mode Exit fullscreen mode

Writing the extra key is cheap insurance. Earlier versions read location, macOS 27 reads location-screenshot, and a Mac that gets upgraded later already has the right value waiting.

Two smaller details in the same function are worth copying. It creates the folder before writing anything, because, as the comment there puts it, macOS will silently fall back to the Desktop if the path is missing. And it restarts SystemUIServer only after the write that matters has succeeded, so the change takes effect immediately for the next screenshot.

Run defaults without spinning the run loop. Pizazoo shells out to /usr/bin/defaults instead of using UserDefaults(suiteName:), because on macOS 15 and later the suite approach triggers the "would like to access data from other apps" privacy prompt. The helper waits for the process on a semaphore with a timeout (5 seconds by default):

let exited = DispatchSemaphore(value: 0)
process.terminationHandler = { _ in exited.signal() }
do {
    try process.run()
} catch {
    return nil
}
guard exited.wait(timeout: .now() + timeout) == .success else {
    process.terminate()
    return nil
}
Enter fullscreen mode Exit fullscreen mode

Why not waitUntilExit()? It spins the current run loop until the child exits, and doing that during a SwiftUI update crashed Pizazoo 1.0.9 on first launch, so the repo now has a rule against it.

What other Mac developers should check

If you ship anything that touches the screenshot location, a few places are worth a look:

  • Scripts and dotfiles. Any setup script, dotfiles repo or onboarding doc that runs defaults write com.apple.screencapture location ... does nothing on macOS 27. Use location-screenshot there, or write both keys if the script runs on Macs with different versions.
  • Apps that read the location. Folder watchers, upload tools, cleanup utilities: if your code reads location to find new screenshots, on macOS 27 it is reading a value the system no longer uses. Check the OS version and read the matching key.
  • Exit status 0 is not proof. defaults write succeeds for any key, including one nobody reads. If a preference change matters, check the behavior: take a screenshot and see where it lands.
  • Create the folder first. A save location that points at a missing folder ends up on the Desktop.
  • Reading another app's preferences. On macOS 15 and later, UserDefaults(suiteName:) for another app's domain can trigger a privacy prompt; running /usr/bin/defaults avoids it. If you do run it as a subprocess, don't block with waitUntilExit() on the main thread.

If you just want your screenshots off the Desktop

The easiest way needs no Terminal at all: press Shift-Command-5, click Options, and pick a folder under Save to.

If you prefer Terminal, on macOS 27 use the new key (replace ~/Screenshots with your folder):

mkdir -p ~/Screenshots
defaults write com.apple.screencapture location-screenshot ~/Screenshots
killall SystemUIServer
Enter fullscreen mode Exit fullscreen mode

To see what's set right now, run defaults read com.apple.screencapture location-screenshot. If the same script has to run on older Macs too, write location as well, since earlier versions only read that one.

I posted a short PSA about this on r/MacOS in October, for anyone who lands there from an old guide. And if you use Pizazoo, the Change Location… button works on macOS 27 from version 1.0.13 on.

Disclosure: Pizazoo is my app. This post was drafted with AI help, working from the commit and the code it quotes.

Pizazoo's Mac app is on pizazoo.com (it isn't on the Mac App Store), and there's a free iPhone and iPad app too.

Top comments (0)