Skip to content

Instantly share code, notes, and snippets.

View April-June-August's full-sized avatar
💭
Learning how to use a keyboard.

May-June-July April-June-August

💭
Learning how to use a keyboard.
View GitHub Profile
@SKaplanOfficial
SKaplanOfficial / now-playing.js
Last active August 10, 2025 07:22
AppleScript and JXA scripts to get Now Playing info. Works on macOS 15.4+, including macOS 26 beta 1.
function run() {
const MediaRemote = $.NSBundle.bundleWithPath('/System/Library/PrivateFrameworks/MediaRemote.framework/');
MediaRemote.load
const MRNowPlayingRequest = $.NSClassFromString('MRNowPlayingRequest');
const appName = MRNowPlayingRequest.localNowPlayingPlayerPath.client.displayName;
const infoDict = MRNowPlayingRequest.localNowPlayingItem.nowPlayingInfo;
const title = infoDict.valueForKey('kMRMediaRemoteNowPlayingInfoTitle');