Si usted simplemente está buscando para cambiar el papel tapiz del escritorio de forma rápida, esto después de AppleScript código debe hacer el truco. Como lo es ahora, el código es sólo elegir las fotos desde su escritorio a la carpeta de imágenes. Ser capaz de utilizar una carpeta diferente para tu escritorio de imágenes, que sin duda puede jugar con el código
Este a mi me funciona con la última versión de macOS Mojave
tell application "System Events"
set fileRef to a reference to files of desktop pictures folder
set picPath to path of fileRef
tell current desktop
set currentPic to get picture as POSIX file as text
set theIndex to my indexOfItemInList(currentPic, picPath)
try
set picture to item (theIndex + 1) of picPath
on error errMsg number errNum
set theIndex to 0
set picture to item (theIndex + 1) of picPath
end try
end tell
end tell
(* THIS HANDLER DETERMINES THE INDEX OF THE CURRENT DESKTOP PICTURE
IN THE LIST OF AVAILABLE DESKTOP PICTURES, TO BE ABLE TO QUICKLY SET
THE NEW DESKTOP PICTURE TO THE NEXT ONE IN THE LIST*)
on indexOfItemInList(theItem, theList)
script fasterList
property fastList : theList
end script
repeat with i from 1 to length of fasterList's fastList
try
if item i of fasterList's fastList = theItem then return i
on error "Item not found." number -1728 from theItem
tell application "System Events"
tell current desktop
set picture to item 10 of picPath
end tell
end tell
end try
end repeat
end indexOfItemInList
Usted mencionó que "El Cambio de Imagen de Cada XXX opción debe ser activada en Preferencias de Escritorio. "en su comentario. No estoy muy seguro de por qué, porque la anterior AppleScript código funciona en mi sistema sin que se comprueba. Sin embargo, si tener esa opción esté activada, esta siguiente AppleScript código hará eso para usted
if application "System Preferences" is running then do shell script "killall 'System Preferences'"
repeat until application "System Preferences" is not running
delay 0.1
end repeat
tell application "System Preferences"
reveal anchor "DesktopPref" of pane id "com.apple.preference.desktopscreeneffect"
activate
end tell
tell application "System Events" to tell application process "System Preferences"
repeat while not (exists of static text 1 of row 2 of outline 1 of scroll area 1 of tab group 1 of window "Desktop & Screen Saver")
delay 0.1
end repeat
set focused of static text "Desktop Pictures" of row 2 of outline 1 of scroll area 1 of tab group 1 of window "Desktop & Screen Saver" to true
if (get value of checkbox 1 of tab group 1 of window 1) is 0 then
click checkbox 1 of tab group 1 of window 1
end if
end tell
if application "System Preferences" is running then do shell script "killall 'System Preferences'"