Re:Getting the download location selected by the user in Safari
Re:Getting the download location selected by the user in Safari
- Subject: Re:Getting the download location selected by the user in Safari
- From: email@hidden
- Date: Fri, 15 Jul 2005 13:34:27 +0200
Hi Manish,
The download directory preference is stored in "com.apple.internetconfig.plist" and not in "com.apple.Safari.plist"
Here is a code snippet you can use to get the system default download directory location......you may have to optimize it a bit.....
OSStatus errr;
ICInstance inst;
ICAttr junk = 0;
ICFileSpec spec;
FSRef fileRef;
NSString *path;
NSURL *pathURL;
long size = sizeof(ICFileSpec);
errr = ICStart(&inst, '????');
if (errr == noErr)
{
//Get the downloads folder
errr = ICGetPref(inst, kICDownloadFolder, &junk, &spec, &size);
//Download directory
NSString *downloadDir = [NSString stringWithCString:spec.fss.name];
//Download volume
NSString *downloadVolume = [NSString stringWithCString:spec.volName];
ICStop(inst);
}
Check ADC Home > Documentation > Carbon > Networking > Internet Config Reference for more information.
Hope this helps.
regards,
Anish Kumar
Software Engineer, MAC OS X,
http://www.qubyx.com/
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden