I have been using this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC -//Apple Computer//DTD PLIST
1.0//EN http://www.apple.com/DTDs/PropertyList-1.0.dtd>
<plist version="1.0">
    <string>tell application "Finder"
set f to POSIX file "/Library/Desktop Pictures/mac cinema desktop yoda.png"
if desktop picture is not file f then set desktop picture to f
end tell</string>

To prevent users from changing the desktop. (And I love it btw!) Original can be found here: How to restrict changing desktop wallpaper?

All of our stations have a secondary screen which I'd also like to fix up the same way using a different image.

Any idea how I can target the secondary display with this code? Thanks for the help!

  • System Events has a desktop suite. (In Applescript Editor, File > Open Dictionary > System Events.app, then click Desktop Suite on the left column) When I try to use it to get the picture property of one of them, I get "invalid key form" errors. This might be something only happening on my system, though, so it's probably worth trying. (update:it just started working) Also, it would help to know your version of OS X. – 0942v8653 Jan 15 '14 at 3:56

Quick Google search revealed the following code:

set tlst to {}
--set newtop to (path to home folder as string) & "Pictures:desktop pics folder:BigDipper 916.jpg" as alias -- sample line
set newtop to choose file

tell application "System Events"
   set tlst to a reference to every desktop
   --set picture of item 1 of tlst to newtop -- display 1
   set picture of item 2 of tlst to newtop -- display 2
end tell

Taken from


I don't have a second monitor so I cannot test it.

Hope it helps.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .