Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save henrik/6adcc1adfd59176dc57d23fa61c66683 to your computer and use it in GitHub Desktop.
Save henrik/6adcc1adfd59176dc57d23fa61c66683 to your computer and use it in GitHub Desktop.
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