Closed lgarron closed 2 years ago
Nice, this is a good fix to have. I'm looking at the code now - I can't get:
NSDictionary *safariPrefs = [defaults persistentDomainForName:@"com.apple.Safari"];
to work for me. It just returns nil
every time. I think it has something to do with sandboxing (I confirm that the key exists at defaults read com.apple.Safari DownloadsPath
).
Also, looking at Firefox, it seems it has its own download setting in ~/Library/Application Support/Firefox/Profiles/XXXXX.default/prefs.js -> browser.download.dir
. Seems like each browser may well have their own path.
To avoid us trying to figure out every browser's downloads dir, I suggest we have a setting in Quicksilver to set the downloads folder. A couple of options:
defaults write com.blacktree.Quicksivler downloadsPath XXXX
(easiest)I think it has something to do with sandboxing (I confirm that the key exists at
defaults read com.apple.Safari DownloadsPath
).
Ah, alas. :-/
This was more of a drive-by fix, so unfortunately I don't think I can contribute more work to it. But feel free to take it and run with it!
I think the right way to fix this is to use -[NSURL fileURLWithString:]
. I've pushed straight to master. Thanks for spotting the bug!
[NSURL URLWithString:downloads]
fails whendownloads
contains spaces. Apparently the solution is to percent-encode the string.