Storing location for a preferences file in a standalone stack?

Klaus on-rev klaus at major.on-rev.com
Sun Sep 30 15:48:09 EDT 2012


Hi Jaqueline,

Am 30.09.2012 um 21:16 schrieb J. Landman Gay <jacque at hyperactivesw.com>:

> On 9/30/12 11:27 AM, Dr. Hawkins wrote:
>> I'm not ready to face the differences in where things go with mac &
>> windows, and dealing with the OS preferences settings.
>> 
>> Is there a way that I can store and change a string in a standalone
>> stack to find the preferences file, where I can then stuff the rest?
>> Should this, perhaps, be a custom property?
> 
> You can do this:
> 
> if the platform = "macos" then
> put specialfolderpath("preferences") into tFolder
> else
> put specialFolderPath("0x001a") into tFolder
> end if
> 
> That gives a path to the OS-approved place to store prefs. You should probably create a folder there named for your app and then put your file into that.
> 
> There's been some discussion about whether Apple still wants prefs stored in Preferences in Mountain Lion (odd as that may seem.) To be safe on all versions of OS X, you may want to use this instead for Macs:
> 
>  put "~/Library/Application Support" into tFolder

This works on the Mac:
specialfolderpath("asup") -> "~/Library/Application Support

4 chars less to type ;-)

> -- 
> Jacqueline Landman Gay         |     jacque at hyperactivesw.com
> HyperActive Software           |     http://www.hyperactivesw.com

Best

Klaus

--
Klaus Major
http://www.major-k.de
klaus at major.on-rev.com





More information about the use-livecode mailing list