Skip to content

Instantly share code, notes, and snippets.

@agentcooper
Last active December 18, 2025 14:57
Show Gist options
  • Select an option

  • Save agentcooper/562c8978076cf7d1423bd3981b8b7ca1 to your computer and use it in GitHub Desktop.

Select an option

Save agentcooper/562c8978076cf7d1423bd3981b8b7ca1 to your computer and use it in GitHub Desktop.
Open currently playing album from Apple Music in Rate Your Music (https://rateyourmusic.com/)
  1. Open 'Script Editor' in macOS (built-in app)
  2. Switch the language from AppleScript to JavaScript
  3. Paste the script
  4. Press Command-S to save, for File Format choose 'Application', for Where choose 'Applications', name it something like RYM.app
  5. Run the new app (for example using Spotlight)
(() => {
const music = Application("Music");
if (music.playerState() !== "playing") {
return;
}
const app = Application.currentApplication();
app.includeStandardAdditions = true;
function slugify(str) {
return str
.toLowerCase()
.replace(/[^\w\s-]/g, "")
.replace(/\s+/g, "-")
.replace(/-+/g, "-")
.replace(/^-|-$/g, "");
}
function cleanAlbumName(album) {
return album
.replace(/\s*\(.*?\)\s*$/g, "") // Remove (...)
.replace(/\s*\[.*?\]\s*$/g, "") // Remove [...]
.trim();
}
function openURL(url) {
app.doShellScript(`open "${url}"`);
}
const track = music.currentTrack();
const artistSlug = slugify(track.artist());
const cleanedAlbum = cleanAlbumName(track.album());
const albumSlug = slugify(cleanedAlbum);
const directURL = `https://rateyourmusic.com/release/album/${artistSlug}/${albumSlug}/`;
openURL(directURL);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment