Tahoe has serious problems with the Wallpaper settings and does not work as advertised, so I need a macro that will do the following: Using a selected folder of images, change the desktop wallpaper daily (can the time of change be specified??), and the next day do the same but using the next image in the folder. It would be good if once it reached the end of the images, it would automatically restart from the first image and repeat the whole process. I’ve tried making a macro myself with no luck. Is there an existing macro out there that will do this?
What's not working? I've just tried "every 5 seconds, sequential, from a folder" and it seems to be working (admittedly only a brief test) in macOS 26.4.1
On OS 26.5.2 - You are correct that the 5 seconds through hourly settings work, but when when set to Every Day, it does NOT change the wallpaper. This is why I need a macro to do this...
While I love me a KM macro, one problem is that they won't trigger while your Mac is off or asleep. Have you got a time every day (or every day that you care about) when your Mac will be awake?
If you want a daily change then look at using a LaunchAgent instead, since those run as soon as possible after their scheduled time (and drop previously-scheduled executions when another is added. So you could set it to run every day at 00:01 and your wallpaper would change then or the next time you logged in to/woke up your Mac.
Has the folder only got images in it? Will you be happy to show them in alphabetical order or do you have a different sort in mind?
As long as the macro kicks in when I first log on to the Mac that is good enough
The folder only has images in it and I am fine with showing them in alphabetical order
I have written a rather complete desktop wallpaper system in KM. I use it on two computers with multiple monitors. It works on Tahoe on a daily basis, and one Sequoia laptop. You can set the wallpaper switch time in a configuration window. My system is pretty complex, but it works quite well. I’ve spent a huge amount of time debugging it. You are completely correct, wallpaper in Tahoe is pretty messed up along a number of dimensions. There is also a trick to resetting the wallpaper folders, requiring a reboot. I can upload it if you like. Let me know.
OK, rather than keep you in suspense, here it is:
2026-07-16 Desktop Images Macros.kmlibrary (452.3 KB)
While I normally try to use "native" KM Actions when possible, KM has no quick way of listing a folder's contents (you can, of course, "For Each" and build your own -- but that takes time).
Since we need to use AppleScript to both get the current wallpaper and set the new, we may as well get the folder contents there too and get everything done at the cost of only one AS instantiation.
The downside is that the image files will be listed in UNIX sort order, so A comes before B, but B comes before a and so on. That can be fixed, so shout if it's a problem.
The script:
set inst to system attribute "KMINSTANCE"
tell application "Keyboard Maestro Engine"
set imageFolderPath to getvariable "Local_imageFolderPath" instance inst
end tell
tell application "Finder"
set theFolder to (imageFolderPath as POSIX file) as alias
set AppleScript's text item delimiters to linefeed
set nameList to (name of every file of theFolder) as text
set AppleScript's text item delimiters to (name of (get desktop picture) & linefeed)
try
set desktop picture to POSIX file (imageFolderPath & "/" & (paragraph 1 of text item 2 of nameList))
on error
set desktop picture to POSIX file (imageFolderPath & "/" & (paragraph 1 of nameList))
end try
end tell
We're passing the image folder path in as a variable so that you can easily set it by editing the first Action of the macro. You can get the path by right-clicking the folder, holding down the ⌥ key, and selecting "Copy Xxxx as Pathname". If there's a space in the path what you Paste into the Action will be wrapped in single quotes -- remove them.
The macro, set to trigger on login:
Change Wallpaper at Login.kmmacros (2.9 KB)
Ask if you've any questions.
And I've no doubt that @ikenassi's macro will be both more robust and more configurable than this -- he's certainly put a lot more work into it!
Just and FYI: I put an alias for a command to reset the wallpaper database. Once you invoke it, reboot. Works fine:
wallpaper-reset='mv '''/Users/nassi/Library/Containers/com.apple.wallpaper.extension.image/Data/Library/Preferences/com.apple.wallpaper.extension.image.plist''' ~/Desktop'
Many thanks in advance for the macro - I will not be able to check it out for a few days, but I'll let you know how it turns out
Hi - Thanks for the input and the macro - I'm not be able to get to it for a few days, but I'll let you know how it works
I can not get this to work - I have put the folder path in the Set Variable... "to" field. Does the folder path need to be placed anywhere in the AppleScript also?
I have no idea how to set this up on my computer. Help, please...
I’ve been using it so long it is all automatic for me.
After installing:
- Help may not be totally up to date, but you can type "ctrl-option-shift-=."
- I would first invoke the DT Initialize macro ^-shift-I.
- Then I would set the parameters: DT Change Settings with option-shift-G.
- Depending on what you put in settings, it’s all automatic.
- But if you want to start the screensaver manually, invoke Start Screensaver with ctrl-shift-N. Move the or click the mouse, or type a key, or to force it to stop, type ctrl-ESC.
Let me know if you have any more questions
Just to verify - I am not trying to change the screen saver (as you have mentioned in item 5 below) - I am trying to have the wallpaper change daily. If your macro does not do this, please let me know.
But if it does change the wallpaper - can you please describe all the steps needed to set this up? Sorry, but I still can't figure out how to do this...
I don’t think it will do that. If you set the time between spaces to be the number of seconds in 24 hours, then it every 24 hours it will change the image on every desktop space.
However, this assumes the screen saver is running. If it’s not running, which it will not be if the system is not idle, the screensaver will not start.
But you can modify this to do what you want, I think. You have to change the frequency of the cron job to 24 hours (it defaults to every 5 minutes), probably among other changes.
No, you only have set the value in the first Action.
Check that is correct -- full path, no escaped spaces, no single quotes front and back, no trailing /, no Return character that might have crept in -- and make sure KM's Notifications are turned on so you can see any error message.
If you're still stuck, upload your version here so we can take a look.
Still does not work...
Here is the macro.
(attachments)
Change Wallpaper at Login.kmmacros (2.98 KB)
Was there any error message? Does it work if you use the run button rather than triggering at login (you may have to add a delay to let the login process first)?
I have assumed you are already using a picture from that folder, but it might be safer to catch that error too. So try this (it just moves the "split the list by current image name" into the try block):
set inst to system attribute "KMINSTANCE"
tell application "Keyboard Maestro Engine"
set imageFolderPath to getvariable "Local_imageFolderPath" instance inst
end tell
tell application "Finder"
set theFolder to (imageFolderPath as POSIX file) as alias
set AppleScript's text item delimiters to linefeed
set nameList to (name of every file of theFolder) as text
try
set AppleScript's text item delimiters to (name of (get desktop picture) & linefeed)
set desktop picture to POSIX file (imageFolderPath & "/" & (paragraph 1 of text item 2 of nameList))
on error
set desktop picture to POSIX file (imageFolderPath & "/" & (paragraph 1 of nameList))
end try
end tell
I get no error message
New option also does nothing, I have tried it using the run button
