Apple photos

From malue-ai/dazee-small · View interactive version

Apple photos is an AI agent skill from the GitHub repository malue-ai/dazee-small. Search and manage Apple Photos library on macOS via osascript.

How to use this skill

Skill file

Apple 照片

通过 AppleScript/JXA 管理 macOS 照片库,搜索、导出、创建相册。

使用场景

执行方式

搜索照片

osascript -e '
tell application "Photos"
    set results to (media items whose description contains "Tokyo" or name contains "Tokyo")
    set output to ""
    repeat with photo in (items 1 thru (min of {20, count of results}) of results)
        set output to output & (id of photo) & " | " & (filename of photo) & " | " & (date of photo) & linefeed
    end repeat
    return output
end tell'

按日期范围搜索

osascript -e '
tell application "Photos"
    set startDate to date "2025-12-01"
    set endDate to date "2025-12-31"
    set results to (media items whose date ≥ startDate and date ≤ endDate)
    return (count of results) & " photos found"
end tell'

获取相册列表

osascript -e '
tell application "Photos"
    set output to ""
    repeat with a in albums
        set output to output & (name of a) & " (" & (count of media items of a) & " items)" & linefeed
    end repeat
    return output
end tell'

创建相册

osascript -e '
tell application "Photos"
    make new album named "旅行 2026"
end tell'

导出照片

osascript -e '
tell application "Photos"
    set targetAlbum to album "旅行 2026"
    set exportPath to POSIX file "/Users/me/Desktop/export/"
    export (media items of targetAlbum) to exportPath
end tell'

输出规范

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.