Thursday, December 13, 2012 at 9:22 AM by
Joseph Linaschke Sandboxed Preferences for Aperture
I was looking to trash my Mail.app preferences this morning and I know I’d looked before, and hadn’t found them. The file used to be com.apple.mail.plist and located in ~/Library/Preferences/ however that file no longer exists (and if it does, it’s just a holdover from a previous OS). Finally today I found a discussion online that explained because Mail.app is a “sandboxed” app, that the preferences have moved to a new location. And what else did I find in this new location? An entire Aperture folder I did not previously know existed!
Aperture’s sandboxed folder (click to view larger)
The sandboxed folder is located in ~/Library/Containers/com.apple.Aperture/ and within there is loads of stuff that frankly I don’t know what is all about yet. There’s a container.plist file, then a Data folder and within that, a series of aliases mimicking your home directory. On mine there’s a single JPG file just hanging out there (no idea what that’s all about) a Documents folder (not alias) containing an alias to an iChats folder — maybe because I dragged a photo from Aperture to iChat/Messages once?
More interestingly, if you look in the Library folder you’ll find an Application Support folder, and in there the *.apcommands file that had gone missing for many in one of the post Aperture 3.3 upgrades. You’ll also find *.plist files for various plug-ins to Aperture. Looking in the actual Preferences folder here you’ll find tons of aliases to other preference files, more *.plist files for other plugins, presets for all those plugins that we lost when this sandbox update didn’t handle the migration to sandboxed very well, and bafflingly, an alias to the com.apple.Aperture.plist file, the original of which still lives in the ~/Library/Preferences/ where it used to.
Any software engineers out there who’d care to shed some light on why we see so many seemingly irrelevant aliases in here, and why the Aperture preference file itself is not in the sandbox folder?

















Reader Comments (2)
This may or may not be related to this newly discovered folder. Nevertheless it may be useful since there seems so little information available on how recent Aperture updates are changing its behavior.
My primary Aperture library on my desktop Mac, which remains on all the time, is set to automatically import Photostream images as they appear. Traditionally, the import occurred whenever I launched Aperture.
Yesterday I created a screen grab on my iPhone, and deleted it from the camera roll and Photostream almost immediately. When I launched Aperture this morning, the screenshot appeared imported into the monthly Photostream project but not in the Photostream itself.
This behavior suggests that the Mac cached Photostream additions in almost real time. And I'll bet they were buried in this new container folder. Whereas earlier versions of Aperture seemed to import images via the Internet connection upon launch.
Bob
The whole folder structure is related to Aperture being sandboxed now. Sandboxed Apps can only access specific folders by default. To access other files or folders, the user must allow it manually via Open/Save panel. These Apps need 'special' preferences folders as well, and each app is allowed to access its own preferences folder by default. The preferences are located in ~/Library/Containers/[com.appdomain.appname].
Sandboxed Apps also need a way to keep track of any file the user allowed to access. My guess is, that Apple handles that by using different types of symlinks in the application specific preferences folder.
For example, look into
~/Library/Containers/com.apple.Aperture/Data/Pictures(which refers to the Pictures folder in your home-directory). There you can access all files inside this folder directly (because Aperture is allowed access to your Pictures folder by default). Then look into~/Library/Containers/com.apple.Aperture/Data/Library. There you'll find lots of folder-aliases (to which Aperture has at least no write access) and some 'real' folders like Caches which Aperture can fully access.You can read more about sandboxing in OS X in Apple's official documentation:
Apple Developer Documentation - About App Sandbox and Apple Developer Documentation - Designing Your Sandbox