Referencing standard directories and applicationFolder

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
aetaylorBUSBnWt
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 118
Joined: Thu Sep 20, 2012 5:11 pm

Referencing standard directories and applicationFolder

Post by aetaylorBUSBnWt » Wed Sep 23, 2020 12:03 am

Hi,

Coming from developing applications using Xcode on MacOSX.
On the Mac, there are a number of folders where stuff is supposed to go. Some of it is relative to the current user's home folder and some of it is relative to the application itself.
I seem to remember something similar with Windows, but it has been a decade or more since I was involved with a Windows app.

I thought defaultFolder might be a start, but its contents at application launch are dependent upon how the user launched the application - so useless for use as a constant known value.

I need to package a number of files with my application that on a Mac would be installed in the application package. Some are referenced read-only, others are the template for files that end up in the user's data folders.

Is there something in LiveCode that provides a cross platform access to the application folder - that is initialized when the application launches and is constant during that run of the application?

Is there a cross platform equivalent to the MacOSX "Documents" folder - the default for where a user's data goes - so where an application should start when suggesting to the user for where to save a data file?

Is there a cross platform equivalent to the MacOSX "Home" folder - which is the base folder for the user's files?

What is LiveCode's suggested practice for getting at such stuff?

Semi-related question: I am still trying to find where OS specific functionality is documented. For example: if I find that I am running on a Mac, then getting the "Application Folder" filepath. Or doing the equivalent on Windows or Linux.


Thanks,
Andrew

SparkOut
Posts: 2852
Joined: Sun Sep 23, 2007 4:58 pm

Re: Referencing standard directories and applicationFolder

Post by SparkOut » Wed Sep 23, 2020 12:17 am

There are a number of cross platform folder locations referenced by the specialFolderPath() function, if you look that up in the LiveCode dictionary. The specialFolderPath("documents") or specialFolderPath("resources") for instance.

For additional codes, particularly regarding Windows CSIDL references, the definitive guide was written by Ken Ray some years ago, but still valid today even on Windows 10. http://www.sonsothunder.com/devres/live ... ile010.htm

For case-sensitive O/S reasons, please remember to keep the folder designation all lower case.

aetaylorBUSBnWt
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 118
Joined: Thu Sep 20, 2012 5:11 pm

Re: Referencing standard directories and applicationFolder

Post by aetaylorBUSBnWt » Thu Sep 24, 2020 12:24 am

Excellent,
Thanks.
Now there is a more recent reference to this information - I could not find it in the most recent 12 pages of topics.

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”