Grazie per il tuo contributo
Quindi alla fine sono riuscito a farlo (almeno credo di sì)
Ho incorporato un oggetto Applescript per cambiare lo sfondo in uno script di shell che ho aggiunto a launchd.
Ecco come appare:
Script "scriptly.sh"
#!/bin/bash
osascript -e '
set myhour to get the (hours of (current date))
set myminutes to get the (minutes of (current date))
set mypicturenumber to (myhour - 12) * 12 + myminutes / 5 as integer
if mypicturenumber < 0 then
set mypicturenumber to (288 + mypicturenumber)
end if
set picnumber to 0
if mypicturenumber > 99 then
set picnumber to "0" & mypicturenumber
end if
if (99 ≥ mypicturenumber) = (9 < mypicturenumber) then
set picnumber to "00" & mypicturenumber
end if
if 9 ≥ mypicturenumber then
set picnumber to "000" & mypicturenumber
end if
tell application "Finder"
set desktop picture to {"Macintosh HD:users:USERNAME:Individualfile:backgrounds:earth:earth24h" & picnumber & ".png"} as alias
end tell
'
file launchd "com.individual.Background.plist"
<?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">
<dict>
<key>Label</key>
<string>com.individual.Background</string>
<key>ProgramArguments</key>
<array>
<string>/bin/sh</string>
<string>/Users/USERNAME/Individualfile/scriptly.sh</string>
</array>
<key>StartInterval</key>
<integer>300</integer>
<key>UserName</key>
<string>USERNAME</string>
</dict>
</plist>
comando per metterlo in azione
launchctl load /Users/USERNAME/Individualfile/com.individual.Background.plist
EDIT:
L'ultimo comando è lì per caricare direttamente lo script, tuttavia non verrà eseguito all'avvio. Per farlo Devi copiare il file
com.individual.Background.plist
nella cartella ~ / Libary / LaunchAgents /.