Skip to main content
Home

Main navigation

  • Apps
  • Forum
  • Blog
    • Podcast
    • Guides
    • Hardware & Accessory Reviews
    • Bug Tracker
    • Developer Resources
  • Log in

Breadcrumb

  1. Home
  2. Forums
  3. macOS and Mac Apps

Chat GPT Generated AppleScript for Music

By Kevin Shaw, 8 January, 2023

Forum
macOS and Mac Apps

Have you ever been listening to the Music app on Mac OS and went, "Oh, I wonder what song this is?"
For me, that means command-tabbing to the Music app, getting to the LCD area, interacting and then reading the song title and artist.
Wouldn't it be great to hit one key and hear song title and artist, no matter what app you were in?
Well, thanks to Chat GPT, we now have a simple AppleScript that does this.

Copy the below text into ScriptEditor which is in your Utilities folder.
Make a new script and paste the below text.

tell application "Music"
set currentTrack to current track
set trackName to name of currentTrack
set artistName to artist of currentTrack
set trackInfo to "Now playing: " & trackName & " by " & artistName
tell application "VoiceOver"
say trackInfo
end tell
end tell

Command S to save. Give it a name and save it. I used the default folder.
Open VoiceOver Utility and navigate to Commanders>Keyboard.
Add a keystroke and select Custom Commands from the menu. Choose run AppleScript. Navigate to the file you saved. For me, I used the default ScriptEditor folder on iCloud Drive and right-option Q for the keystroke.

Now, when I hit right-option Q, VoiceOver says the song title and artist of the currently playing song. Pretty nifty.

Pretty nifty, eh?

Options

  • Log in or register to post comments

Comments

Chat GPT

By peter

2 months 2 weeks ago

Yes, chat GPT can be used to write code in almost any language. Sometimes it isn't perfect, but can be a very good template or starting point. If it does produce code that makes an error when run, you can also tell the AI what error was produced and it will atempt to fix the code. thus you can use this interactively to improve and/or enhance code it writes.

I've also used it to write lyrics for songs. Pretty cool.

--Pete

More Like This

VoiceOver goes quiet when using Command-Tab on Big Sur, anyone else? (Forum Topic)
VoiceOver speech cadences are unnatural (macOS Bug Report)
VoiceOver unresponsive for a few seconds after wake on Big Sur, anyone else? (Forum Topic)
acaville (iOS and iPadOS App Directory)
Some thoughts on using the new Chat GPT AI bot, portions of this post were generated by an A.I. bot (Forum Topic)
Cannot control-drag in Xcode canvas with VoiceOver (macOS Bug Report)
Yo, Human! Tweaking My Mac: Accessing Life with Adaptive Technology (Blog Post)
UIScanner AppleScript available (Forum Topic)

Site Information

  • About
  • Club AppleVis
  • FAQ
  • Contact

Unless stated otherwise, all content is copyright AppleVis. All rights reserved. © 2023 | Accessibility | Terms | Privacy