Skip to content

Show application locations matching Finder's behaviour - #3128

Open
danielcompton wants to merge 4 commits into
quicksilver:mainfrom
danielcompton:claude/gifted-haslett-5d6265
Open

Show application locations matching Finder's behaviour#3128
danielcompton wants to merge 4 commits into
quicksilver:mainfrom
danielcompton:claude/gifted-haslett-5d6265

Conversation

@danielcompton

@danielcompton danielcompton commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

macOS shows applications in the /Applications folder that may not actually exist there on disk.

There are two cases:

  1. Cryptex backed applications like Safari - these are in a path like /System/Volumes/Preboot/Cryptexes/App/System/Applications/Safari.app. This path isn't genuinely visible to users. /Applications appears to contain Safari.app but it is just a symlink to the cryptex.
$ ls -l /Applications/Safari.app
lrwxr-xr-x@ 1 root  wheel  54 23 Jul 09:57 /Applications/Safari.app@ -> ../System/Cryptexes/App/System/Applications/Safari.app
$ ls -l /System/Cryptexes/App/System/Applications/Safari.app
total 0
drwxr-xr-x  11 root  wheel  352 16 Jul 18:22 Contents/
  1. System applications like Find My - these are in a path like /System/Applications/FindMy.app. There is no symlink to /Applications, but Finder will display these system applications in /Applications.

E.g.

$ ls -l /Applications/FindMy.app
ls: /Applications/FindMy.app: No such file or directory
$ ls -l /System/Applications/FindMy.app
total 0
drwxr-xr-x  11 root  wheel  352 23 Jul 09:57 Contents/

This PR fixes both of these issues. It merges applications found at multiple locations, e.g. the symlinked /Applications/Safari.app + Cryptex Safari.app if they both resolve to the same user visible location.

See https://developer.apple.com/forums/thread/745673 for more discussion on cryptexes.

Changes

  • Add NSURL category for user-visible paths
  • Catalog apps at their user-visible path instead of cryptex backing path
  • Show system applications at their Finder location
  • Document the Additional Applications preset as a cryptex fallback

Fixes #3125

I checked how Alfred handles this and it appears to just use hardcoded string comparisons to replace certain applications with the user visible path. I think these changes are more principled and correct.

@danielcompton
danielcompton force-pushed the claude/gifted-haslett-5d6265 branch from ab3007d to f86b306 Compare August 20, 2026 04:11

@skurfer skurfer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but I had a couple of questions.

Comment thread Quicksilver/PlugIns-Main/QSCorePlugIn/Code/QSDirectoryParser.m
Comment thread Quicksilver/PlugIns-Main/QSCorePlugIn/QSCorePlugIn-Info.plist
Comment thread Quicksilver/Code-QuickStepFoundation/NSURL_BLTRExtensions.m Outdated
macOS ships some system apps (Safari, and previously others) in a
cryptex that is grafted into the file system, so the same file is
reachable both through its user-visible path (/Applications/Safari.app,
a symlink) and its backing location (/System/Cryptexes/App/... or the
resolved /System/Volumes/Preboot/Cryptexes/App/... form that directory
enumerators report). Finder also presents the system domain Applications
directories merged into the local /Applications folder, which is where
users know apps like Find My and Music.

There is no direct API for either mapping (see
https://developer.apple.com/forums/thread/745673, which also notes
Spotlight paths for these files are unstable across index states), so
derive it from NSSearchPathForDirectoriesInDomains(NSApplicationDirectory,
NSSystemDomainMask), which reports both /System/Applications and the App
cryptex directory:

- URLByMappingSystemApplicationsToLocalDomain maps a path inside a
  system Applications directory (any form) to the local /Applications
  equivalent: the Finder-displayed location, which may not exist on
  disk. Paths inside bundles are left unmapped, as in Finder.
- URLByResolvingToUserVisiblePath additionally requires the mapped path
  to exist and be the same file (NSURLFileResourceIdentifierKey, the
  identity check recommended by Apple DTS), so it always returns a path
  that exists.

The mapping is gated on a string prefix comparison, so paths outside the
system Applications directories cost no filesystem access.

Part of quicksilver#3125
Launch Services and directory scans through /System/Cryptexes report
cryptex-shipped apps (e.g. Safari) at their backing location, so the
catalog showed Safari at
/System/Volumes/Preboot/Cryptexes/App/System/Applications/Safari.app
instead of /Applications/Safari.app. The different sources (Applications
preset, Additional Applications preset, and Find All Applications) could
also each produce a distinct object for the same app because their paths
differed.

Resolve application URLs to their user-visible path in the two catalog
sources that see backing paths: the Launch Services app list
(allApplicationsURLs) and QSDirectoryParser (for application bundles
only), so every source yields the same object at the path users see in
the Finder.

Part of quicksilver#3125
Apps like Find My and Music were displayed with /System/Applications,
and symlinks to the App cryptex (like /Applications/Safari.app) with
their fully-resolved backing path under /System/Volumes/Preboot, instead
of the /Applications location the Finder shows them in.

Map the details string through
URLByMappingSystemApplicationsToLocalDomain. The mapping is a string
prefix comparison against the system Applications directories, so
details for ordinary files still touch no filesystem.

Fixes quicksilver#3125
With apps canonicalized to their user-visible path at catalog time, the
cryptex scan yields the same object as the Applications preset for any
app that also has an /Applications symlink (today, all of them). Keep
the preset as coverage for a future cryptex app shipped without a
symlink -- the failure mode of quicksilver#2932 -- and note that in the plist.

Also scan it at depth 3 to match the other Applications presets, in
case apps are ever nested there.
@danielcompton
danielcompton force-pushed the claude/gifted-haslett-5d6265 branch from f86b306 to b86cd69 Compare August 22, 2026 02:50
@skurfer

skurfer commented Aug 24, 2026

Copy link
Copy Markdown
Member

I tested this out locally and pulled up Safari. The details look correct, but the Get Path action doesn’t actually grab the user-friendly path. Does that work on your end?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Safari is displayed using Cryptex backing path instead of /Applications/Safari.app

2 participants