I'm using the following to let a user pick a file to save in my macOS app:
let panel = NSSavePanel()
let resp = panel.runModal()
if(resp == .OK)
{
let strFilePath = panel.url?.path();
}
The problem is that NSSavePanel::url::path
escapes spaces (and possibly other characters) in a path. So instead of:
/Users/user/Documents/file 2.txt
I'm getting:
/Users/user/Documents/file%202.txt
So how do I get it to return the former path?