# Accessing PropertiesFile from Plugin

**URL:** <https://forum.juce.com/t/accessing-propertiesfile-from-plugin/12208>\
**Category:** Audio Plugins\
**Created:** [January 14, 2014, 9:17pm UTC](https://forum.juce.com/t/accessing-propertiesfile-from-plugin/12208 "2014-01-14T21:17:53Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![chkn](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/chkn/32/3862_2.png) [@chkn](https://forum.juce.com/u/chkn)\
**Post date:** [January 14, 2014, 9:17pm UTC](https://forum.juce.com/t/accessing-propertiesfile-from-plugin/12208/1 "2014-01-14T21:17:53Z")

</div>

I try to open my properties from a AU plugin in Garageband, and it should open this file

/Users/christian/Library/Preferences/com.mycompany.myplugin/myplugin.settings

instead it opens&nbsp;

/Users/christian/Library/Containers/com.apple.garageband10/Data/Library/Preferences/com.mycompany.myplugin/myplugin.settings

This is annoying, cause the installer stores the location of the sample-library in this file

**Is there any chance to open the file, outside the the Garageband Container, maybe through using the "Application Support" or do i have to add other settings, somewhere?**

&nbsp;

&nbsp;

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [January 14, 2014, 9:37pm UTC](https://forum.juce.com/t/accessing-propertiesfile-from-plugin/12208/2 "2014-01-14T21:37:35Z")

</div>

Looks like you're getting sandboxed, so it's not very likely that there'll be an easy workaround for that..

---

<div class="post-metadata">

**Author:** ![chkn](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/chkn/32/3862_2.png) [@chkn](https://forum.juce.com/u/chkn)\
**Post date:** [January 14, 2014, 9:50pm UTC](https://forum.juce.com/t/accessing-propertiesfile-from-plugin/12208/3 "2014-01-14T21:50:00Z")

</div>

well, exactly the same with "Applicatin Support" :-(

any idea, how i can transfer this information to my plugin

EDIT, i read you answer after my relpy

---

<div class="post-metadata">

**Author:** ![chkn](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/chkn/32/3862_2.png) [@chkn](https://forum.juce.com/u/chkn)\
**Post date:** [January 14, 2014, 11:04pm UTC](https://forum.juce.com/t/accessing-propertiesfile-from-plugin/12208/4 "2014-01-14T23:04:42Z")

</div>

Whe i do&nbsp;File::getSpecialLocation(File::userDocumentsDirectory);

i get

fullPath&nbsp;&nbsp; &nbsp;juce::String&nbsp;&nbsp; &nbsp;"/Users/christian/Library/Containers/com.apple.garageband10/Data/Documents"&nbsp;&nbsp; &nbsp;

i don't think this is way its should work?

( I need this for the fallback procedure )

I think its allowed to browse through the user&nbsp;documents directory, because i can browe with my self implemented file browser o\_0 through it

i need just "/Users/Christian/Documents", how do i get this inside a plugin? Any idea?

&nbsp;

&nbsp;

---

<div class="post-metadata">

**Author:** ![railjonrogut](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/railjonrogut/32/505_2.png) [@railjonrogut](https://forum.juce.com/u/railjonrogut)\
**Post date:** [January 15, 2014, 12:08am UTC](https://forum.juce.com/t/accessing-propertiesfile-from-plugin/12208/5 "2014-01-15T00:08:19Z")

</div>

Have you checked out this KVR thread: [http://www.kvraudio.com/forum/viewtopic.php?f=33&t=364851](http://www.kvraudio.com/forum/viewtopic.php?f=33&t=364851)

Rail

---

<div class="post-metadata">

**Author:** ![chkn](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/chkn/32/3862_2.png) [@chkn](https://forum.juce.com/u/chkn)\
**Post date:** [January 15, 2014, 10:38am UTC](https://forum.juce.com/t/accessing-propertiesfile-from-plugin/12208/6 "2014-01-15T10:38:36Z")

</div>

&nbsp;

**JULES: Could you change the PropertiesFile Class, that is possible to save its content in**

**~/Music/Audio Music Apps**

&nbsp;

I think this is the most relevant post, from this thread

&nbsp;

> Hello,&nbsp;  
>   
> Just got a reply from Apple in dev portal.&nbsp;  
>   
>   
> Here are the current recommendations:&nbsp;  
>   
> (a) Safest assumption&nbsp;  
> An AudioUnit has full write access to ~/Music (each AudioUnit host needs this directory anyway, Logic Pro X/GarageBand X and MainStage store their settings, etc in ~/Music/Audio Music Apps). Each plugin will therefore have access to all files in this directory. You could create a hidden directory by prefixing "." in front of the name. I would use the AU-BUNDLE-ID as a directory name to avoid conflicts. This is compatible with or without a sandbox on all OS X versions.&nbsp;  
>   
> (b) Work-around for all other directories relative to $HOME&nbsp;  
> All access to the file system relative to $HOME will end up inside the container of the sandboxed host. To avoid that, you need to find the real home directory (see the sample code below), which will work just fine, because GBX provides full filesystem access. Right now this access is necessary anyway to maintain compatibility with e.g. sample libraries and files somewhere on the system or external hard drives. We plan to move to secure bookmarks in the future.&nbsp;  
>   
> +-(NSString \*)realHomeDirectory&nbsp;  
> +{&nbsp;  
> + struct passwd \*pw = getpwuid(getuid());&nbsp;  
> + if (pw == nil)&nbsp;  
> + return nil;&nbsp;  
> + return [NSString stringWithUTF8String:pw-\>pw\_dir];&nbsp;  
> +}&nbsp;  
>   
> (c) Additional recommendations&nbsp;  
> The following directories seem reasonable for an AudioUnit, if ~/Music is not an option. This way at least the data is in clearly defined directories.&nbsp;  
>   
> - ~/Library/Application Support/\<AU-BUNDLE-ID\>&nbsp;  
> - ~/Library/Caches/\<AU-BUNDLE-ID\>&nbsp;  
> - ~/Library/Preferences/\<AU-BUNDLE-ID\>

&nbsp;

&nbsp;

---

<div class="post-metadata">

**Author:** ![chkn](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/chkn/32/3862_2.png) [@chkn](https://forum.juce.com/u/chkn)\
**Post date:** [January 15, 2014, 10:38am UTC](https://forum.juce.com/t/accessing-propertiesfile-from-plugin/12208/7 "2014-01-15T10:38:59Z")

</div>

thanks!

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [January 15, 2014, 10:42am UTC](https://forum.juce.com/t/accessing-propertiesfile-from-plugin/12208/8 "2014-01-15T10:42:14Z")

</div>

The PropertiesFile class already allows you to use any file you want.

---

<div class="post-metadata">

**Author:** ![chkn](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/chkn/32/3862_2.png) [@chkn](https://forum.juce.com/u/chkn)\
**Post date:** [January 15, 2014, 11:00am UTC](https://forum.juce.com/t/accessing-propertiesfile-from-plugin/12208/9 "2014-01-15T11:00:00Z")

</div>

EDIT: post deleted

&nbsp;

&nbsp;

---

<div class="post-metadata">

**Author:** ![chkn](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/chkn/32/3862_2.png) [@chkn](https://forum.juce.com/u/chkn)\
**Post date:** [January 15, 2014, 11:29am UTC](https://forum.juce.com/t/accessing-propertiesfile-from-plugin/12208/10 "2014-01-15T11:29:57Z")

</div>

yes, i see :) i will try it, and will give a feedback

---

<div class="post-metadata">

**Author:** ![chkn](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/chkn/32/3862_2.png) [@chkn](https://forum.juce.com/u/chkn)\
**Post date:** [January 15, 2014, 11:43am UTC](https://forum.juce.com/t/accessing-propertiesfile-from-plugin/12208/11 "2014-01-15T11:43:03Z")

</div>

Wow, seems to work :)

return new PropertiesFile(File("~/Music/Audio Music Apps/MyCompany/MyPlugin.settings"),options);

&nbsp;

---

<div class="post-metadata">

**Author:** ![lalala](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/lalala/32/8577_2.png) [@lalala](https://forum.juce.com/u/lalala)\
**Post date:** [April 2, 2014, 12:08am UTC](https://forum.juce.com/t/accessing-propertiesfile-from-plugin/12208/12 "2014-04-02T00:08:00Z")

</div>

Thanks for that thread! has something changed about those apple recommendations?

meanwhile I think it's better if we all put our files in the same place..  
Did you all decided to go with "~/Music/Audio Music Apps/YourCompany/" for the settings and users'presets file?  
&nbsp;

---

<div class="post-metadata">

**Author:** ![monotomy](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/monotomy/32/960_2.png) [@monotomy](https://forum.juce.com/u/monotomy)\
**Post date:** [October 13, 2014, 8:34pm UTC](https://forum.juce.com/t/accessing-propertiesfile-from-plugin/12208/13 "2014-10-13T20:34:39Z")

</div>

Why not store data in ~/Music/YourApp/ ?

Apple use the Music folder e.g. with Logic directly (~/Music/Logic/&nbsp; ). Can we do the same? (Ok, logic is in the AppStore and not sandboxed... :-) )
