specialFolderPath function (Mac OS X)

Dave Cragg dcragg at lacscentre.co.uk
Sat Dec 21 17:07:01 EST 2002


I just made a small discovery concerning the specialFolderPath 
function on Mac OS X. (Apologies if this is common knowledge.)

There was some discussion in the past on this list about extending 
the specialFolderPath function on Windows with numerical codes. (Ken 
Ray very kindly documented these codes on his site. 

I was wondering whether there was anything similar for Mac OS X (I 
was wanting to locate a user's "Application Support" folder). After 
looking around some sample AppleScripts, I discovered there are 
indeed various codes ( a huge number it seems). And these codes 
(mostly 4-character strings) seem to work with the specialFolderPath 
function. For example:

get specialFolderPath("cusr") returns (on my system) 

get specialFolderPath("asup") returns "/Library/Application Support"

After further poking around, I found these codes can be found 
(amongst other stuff) in the "folders.h" file which resides deep in 
the Library folder (try a find in the Finder to locate it).

It looks like the file contains codes for both OS X and earlier OS 
versions, but I've not been able to test them on Mac OS 8/9 yet.

Bear in mind that these extensions to specialFolderPath aren't 
documented, and therefore we should assume they aren't officially 
supported. (Probably with good reason as not all codes will work 
across all OS versions). But I thought it might be of use to someone.


More information about the Use-livecode mailing list