Skip to content

QSDownloads: support Safari download folders containing spaces. #2751

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

lgarron
Copy link
Contributor

@lgarron lgarron commented Apr 26, 2022

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

@pjrobertson
Copy link
Member

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:

  • Set it using defaults write com.blacktree.Quicksivler downloadsPath XXXX (easiest)
  • Add a preference to Quicksilver Prefs > Extras (fairly easy)
  • Add it as a 'source option' for the 'Latest Download' proxy object catalog source (hardest).

@lgarron
Copy link
Contributor Author

lgarron commented Apr 27, 2022

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
Copy link
Member

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

@lgarron lgarron deleted the downloads-folder-with-spaces branch April 29, 2022 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants