Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Export modified (not original) photos from Photos.app to a folder, to work around a screensaver bug.
-- Works around a bug where Photos screensavers show original rather than edited versions:
-- https://discussions.apple.com/thread/7881820
--
-- This script exports edited versions to a folder, which the screensaver can then be configured to use.
-- Run it on a schedule e.g. via crontab.
-- By Henrik Nyh <https://henrik.nyh.se> under the MIT licence.
set albumName to "Skärmsläckare" -- Export from this album.
set exportFolder to POSIX file (do shell script "echo ~/Library/original_photos_for_screensaver") -- To this folder.
-- We don't delete via Finder, to avoid filling up the trash.
do shell script "rm -rf " & quoted form of (POSIX path of exportFolder)
tell application "Photos"
with timeout of 3600 seconds
export (get media items of album albumName) to exportFolder
end timeout
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment