quicksilver / Quicksilver

Quicksilver Project Source
http://qsapp.com
Apache License 2.0
2.73k stars 285 forks source link

QSDownloads: support Safari download folders containing spaces. #2751

Closed lgarron closed 2 years ago

lgarron commented 2 years ago

[NSURL URLWithString:downloads] fails when downloads contains spaces. Apparently the solution is to percent-encode the string.

pjrobertson commented 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:

lgarron commented 2 years ago

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!

pjrobertson commented 2 years ago

I think the right way to fix this is to use -[NSURL fileURLWithString:]. I've pushed straight to master. Thanks for spotting the bug!