• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re:Getting the download location selected by the user in Safari
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Prev by Date: Re: Is NSEntityDescription insertNewObjectForEntityForName:inManagedObjectContext: this slow?
  • Next by Date: Re: Is it always necessary to lock around mutations of an NSMutableDictionary?
  • Previous by thread: Re: html for safari on the fly
  • Next by thread: Draw a portion of NSTextView
  • Index(es):
    • Date
    • Thread