Browse the docs

Set desktop picture

Sets the desktop picture on one screen or on every screen.

Set the desktop picture to path

Keyboard Maestro: SetDesktopImage

Details #

Sets the desktop picture to the image at path. ~ is your home folder, and the path can use variables. The file must exist.

Without screen, every desktop gets the picture. With screen set to 1 or more, only that desktop does. Numbers of 0 or less count as not given.

The step has no output.

Parameters #

ParameterTypeRequiredValuesWhat it does
pathtextYesThe picture file. Required. The step fails with "no picture at … to use as the desktop" if it is not there.
scalingtextAccepted so imported macros keep it, but it is not applied. Any value other than FillScreen adds a note to the result saying macOS chooses the scaling.
screennumberThe desktop number, starting at 1. Leave it out for every desktop.

Every step also accepts label, onFailure, timeout and dryRunSafe.

Examples #

Replace the path first, since this really changes your wallpaper:

Set the wallpaper on every screen (really changes it)
Do
  1. Set the desktop picture to “wallpaper.jpg”
  2. Show “Wallpaper changed”
Open in Switchboard to try it

Gotchas #

  • The picture is set through System Events, so Switchboard Engine needs Automation permission for it. Without it the step fails and points to System Settings > Privacy & Security > Automation.

  • In a dry run the step is simulated.

See also #

Light or dark mode, File operation