Tengo un Air de 11", por lo que generalmente ejecuto todas mis aplicaciones abiertas en modo de pantalla completa. Tengo un launchd
trabajo para mi usuario que ejecuta un script cada hora y cada inicio de sesión para configurar el fondo del escritorio según la hora del día. El problema es que , a pesar de ejecutarse en segundo plano, a menos que inicie sesión o esté inactivo en el "espacio" del escritorio, no se configurará.
Curiosamente, también cambia al modo oscuro por la noche (o al modo claro durante el día) y esa parte del guión funciona bien.
Entonces, si voy a mi pantalla completa Terminal.app
y ejecuto las siguientes líneas, no funcionan para cambiar el fondo del escritorio:
osascript -e "tell application \"Finder\" to set destop picture to POSIX file \"<path>\""
o
osascript -e "tell application \"System Events\" to set picture of every desktop to \"<path>\""
o incluso
tell application "System Events"
set desktopCount to count of desktops
repeat with desktopNumber from 1 to desktopCount
tell desktop desktopNumber
set picture to "<path>"
end tell
end repeat
end tell
¿Alguien sabe cómo hacer que esto funcione?
Llego tarde a la fiesta, pero esto debería funcionar para ti:
-- Set user_project_path to the folder that contains this AppleScript
set user_project_path to POSIX path of ((path to me as string) & "::")
-- Assuming your images are contained in user_project_path directory inside an images folder
set images_directory to user_project_path & "images/" as string
tell application "System Events"
set desktopCount to count of desktops
repeat with desktopNumber from 1 to desktopCount
tell desktop desktopNumber
-- Change my-desktop-image.png below to the name with extension of your desired image
set picture to images_directory & "my-desktop-image.png"
end tell
end repeat
end tell
Si tienes preguntas, házmelo saber.
chrissphinx
adamdehaven
chrissphinx
adamdehaven