Skip to content

Instantly share code, notes, and snippets.

@yuhonas
Created January 3, 2024 11:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yuhonas/2c329f010665885e91ff9ae39a6e8042 to your computer and use it in GitHub Desktop.
Save yuhonas/2c329f010665885e91ff9ae39a6e8042 to your computer and use it in GitHub Desktop.
Using apple script prompt the user for an image file then set it on every desktop
tell application (path to frontmost application as text)
try
set imageFile to (choose file with prompt "Select an image file:" of type "public.image") as text
end try
end tell
tell application "System Events"
repeat with desktopIndex from 1 to count of desktops
tell desktop desktopIndex
set picture to imageFile
end tell
end repeat
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment