script to set desktop background to a color (Solid White)

Hi,


I'm trying to write a script to change the background color (Solid White).


I typed :

tell application "System Events"


-- GET DESKTOP PICTURE SETTINGS


tell current desktop


get properties


--> returns: {display name:"Color LCD", change interval:1800.0, id:2.077753021E+9, random order:false, picture rotation:0, pictures folder:"/Library/Desktop Pictures/Solid Colors", picture:"/Library/Desktop Pictures/Solid Colors/Solid White.png"}


end tell


end tell



I get this result :

{display name:"Color LCD", change interval:1800.0, id:2.077753021E+9, random order:false, picture rotation:0, pictures folder:"/Library/Desktop Pictures/Solid Colors", picture:"/Library/Desktop Pictures/Solid Colors/Solid Gray Pro Ultra Dark.png", translucent menu bar:missing value, class:desktop}


Can anybody tell me what is wrong?


Posted on Jan 8, 2019 9:03 AM

Reply

Similar questions

8 replies

Jan 8, 2019 11:51 AM in response to Roger Wilmut1

Thank you very much for your answer!

I'm sorry, I'm a beginner in Automator. I created the application in Automator based on your explanation but I don't know how to use it. When I press the RUN button, I get this message : To test this application within Automator, add the “Get Specified Finder Items” action to the beginning of your workflow. Remove or disable the action before running the workflow outside of Automator.


My goal is to assign a shortcut to this task : when I type the shortcut, the Desktop picture is set to Solid White.


In fact, even better for me :

When I tick "Invert colors" (in System Preferences > Accessibility > Display), the Desktop picture is set to "Solid White" and when I untick "Invert colors", the Desktop picture is set to Black.



This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

script to set desktop background to a color (Solid White)

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.