So geht es:
Delphi-Quellcode:
const
NSUserDomainMask = 1;
NSApplicationSupportDirectory = 14;
var
PathList : NSArray;
begin
Pathlist := TNSArray.Wrap(NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, True));
if PathList.count > 0 then
result := UTF8ToString(TNSString.Wrap(PathList.objectAtIndex(0)).UTF8String);
evtl. musst Du die Funktion noch deklarieren:
Delphi-Quellcode:
uses Macapi.cocoatypes, Macapi.foundation, Macapi.CoreFoundation;
function NSSearchPathForDirectoriesInDomains(directory: NSSearchPathDirectory; domainMask: NSSearchPathDomainMask; expandTilde: Boolean): PNSArray; cdecl; external libFoundation name _PU + 'NSSearchPathForDirectoriesInDomains';
Rückgabe dann z.b.: '/Users/greenmile/Library/Application Support'