We're working on an app that will need to access and manipulate the user's current desktop wallpaper.
I can get the wallpaper path using NSWorkspace. The problem is that it's not readable when the app is sandboxed.
guard let wallpaperUrl = NSWorkspace.shared.desktopImageURL(for: NSScreen.main!) else {
return ""
}
// This doesn't read the wallpaper image
print(NSImage(byReferencing: wallpaperUrl))
The app will always need to get the wallpaper, so using an open file modal will not work, especially since the user might not know where the wallpaper is.
I'd prefer not to require users to enable disk access before they can even use the app, because it's not a great first experience.
Is there a way to do this without full disk access?