Re: set picture of current desktop
Re: set picture of current desktop
- Subject: Re: set picture of current desktop
- From: Steve Mills <email@hidden>
- Date: Mon, 11 Jun 2018 10:55:35 -0500
> On Jun 11, 2018, at 10:36, Yvan KOENIG <email@hidden> wrote:
>
> Hello
>
> Is one of you able to tell me what is wrong with this code which is supposed
> to set the picture of the current desktop ?
> It defines the desktop's properties but fails to display the picture.
>
> set theFile to choose file of type {"jpeg", "jpg"}
>
> tell application "System Events"
> set pictFolder to path of container of theFile
> end tell
>
> set PosixFolder to POSIX path of pictFolder
> set PosixFile to POSIX path of theFile
>
> tell application "System Events"
> tell current desktop
> set pictures folder to PosixFolder
> set picture to PosixFile
> get properties
> --> {display name:"iMac", change interval:1800.0, id:69731072,
> random order:false, picture rotation:0, pictures
> folder:"/Users/**********/Desktop/",
> picture:"/Users/**********/Desktop/20170614_154507_p-2017-amenagement-interieur-jean-marc-renou2.jpg",
> translucent menu bar:missing value, class:desktop}
> end tell
> end tell
It seems you also need to set the “picture rotation” to 0. This must mean
“rotate through the pictures folder” instead of the obvious “rotate the image
when rendering to screen”.
If you have multiple screens, you’ll also want to target “desktop n” instead of
“current desktop”. Who knows what “current” means.
Steve via iPhone
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden