Where should user presets be stored (sandboxed app)?

So I’ve been having a devil of a time trying to make sense of this.

I have been working on a synth plugin for a few months. I have both user presets and factory presets. Up until today, my plugin was not sandboxed. My user preset directory was defined as follows:

const String userPresetsDirectoryPath = File::getSpecialLocation(File::userApplicationDataDirectory).getFullPathName() + "/Audio/Presets/MyCompany/MyProduct/";

On Mac, this returned the following directory:


It worked great. I could load presets and I could save presets. But now I’m trying to sandbox my plugin so that it can be submitted to the Mac App Store. That same definition now returns this directory, which is massively long and complicated:


This directory actually doesn’t work for writing. This is because the OS automatically provides symlinks from /Users/MyUsername/Library/Containers/MyBundle/Data/Library/Audio which point to /Users/MyUsername/Library/Audio`. Which means when the “Save as…” dialog pops up, it’s pointing to the old, non-sandboxed directory, and my plugin doesn’t have write access to that directory.

So my question is this: Where should I be storing user presets for a sandboxed Mac app? Ideally, I’d like presets to be shared across VST and AUv3 and Standalone versions of the app.

~/Music/YourApp should work i think

Ah, it works! Thanks!