now-playing

star 0

记录当前 Apple Music 正在播放的歌曲到 journal。当用户提到 now playing、在听什么、记录音乐、/now-playing 时触发。

SizhuangHe By SizhuangHe schedule Updated 3/20/2026

name: now-playing description: "记录当前 Apple Music 正在播放的歌曲到 journal。当用户提到 now playing、在听什么、记录音乐、/now-playing 时触发。" user_invocable: true

Now Playing

抓取 Apple Music 当前播放的歌曲,记录到 journal Notes。

执行流程

  1. 通过 AppleScript 获取 Apple Music 当前播放信息
  2. 写入当天 journal 的 Notes 区块

AppleScript

osascript -e '
tell application "Music"
    if player state is playing then
        set trackName to name of current track
        set trackArtist to artist of current track
        set trackAlbum to album of current track
        set trackDuration to duration of current track
        return trackName & " | " & trackArtist & " | " & trackAlbum
    else
        return "NOT_PLAYING"
    end if
end tell'

写入格式

在 journal Notes 区块追加:

- 🎵 **Now Playing**:{trackName} — {trackArtist} ({trackAlbum})

对话展示

🎵 Now Playing: {trackName} — {trackArtist}
已记录到今天的 journal。

注意事项

  • Apple Music 必须正在播放才能获取信息
  • 如果 Music app 没有运行或没在播放,提示用户
  • 不要自动启动 Music app
  • 多次调用会追加多条记录(不去重,因为可能听了不同的歌)
Install via CLI
npx skills add https://github.com/SizhuangHe/claude-code-skills --skill now-playing
Repository Details
star Stars 0
call_split Forks 0
navigation Branch main
article Path SKILL.md
More from Creator