Storing location for a preferences file in a standalone stack?

J. Landman Gay jacque at hyperactivesw.com
Sun Sep 30 15:16:11 EDT 2012


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

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




More information about the use-livecode mailing list