The `NSWorkspace.shared.desktopImageURL` method should support setting wallpaper for a specific desktop space

Originator:sindresorhus
Number:rdar://45074249 Date Originated:08-Oct-2018 12:05 AM
Status:Open Resolved:
Product:macOS + SDK Product Version:10.14
Classification:Enhancement Reproducible:Always
 
Summary:
In "System Preferences" => "Desktop & Screen Saver", you can set a wallpaper for the current space. So you can switch to the space you want to change the wallpaper for and then set the wallpaper. There should be a way to do this programmatically too.

Steps to Reproduce:
 

Expected Results:
I expected to be able to specify which space to set the wallpaper for with the `NSWorkspace.shared.setDesktopImageURL` API.

I would suggest adding two new methods to `NSScreen`. One for getting all the spaces in the screen (so you could set a wallpaper on all spaces), and one for getting the active space. Using these new APIs, you could get the space you want and then be able to specify it to `NSWorkspace.shared.setDesktopImageURL` as an option.

Actual Results:
There's currently no way to do this.

Version:
10.14

Notes:
Related GitHub issue: https://github.com/sindresorhus/macos-wallpaper/issues/4

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!