dougscripts.com

February 23 2021 - 4:33 pm

View as Songs with Column Browser

One of the things that disappoints me about the Music app (and iTunes before) is that there is no way to set a default playlist View. Whenever a new playlist is created it will default to View as Playlist. I suppose this is fine and I don't dislike View as Playlist; it has its useful moments when a minimal look is desirable. But I prefer View as Songs because I do most of my tag editing and track sorting in that View under which much more information can be made visible.

* * *

For several years I've been pointing out the Keyboard Shortcut trick of assigning Shift-Command-S to View > as Songs and Shift-Command-P to View > as Playlist in order to quickly toggle the playlist View on the fly.

* * *

So I find myself typing Shift-Command-S followed by Command-B to turn on the Column Browser. A lot. Wonder if there's anything I can do about that...

* * *

I hate using GUI scripting but this Shift-Command-S/Command-B dance has gotta stop. What I need is a single keyboard shortcut that fires both of those shortcuts. I've written about System Event scripting to emulate keystrokes and key codes, so it's just a matter of writing a script that presses those shortcuts and then assigning that script a Keyboard Shortcut for the Music app. Here's the script, which I named "My Playlist View" and saved in Music's "Scripts" folder:

tell application "Music"

activate

try

tell application "System Events" to keystroke "s" using {command down, shift down}

end try

delay 0.2

try

tell application "System Events" to keystroke "b" using {command down}

end try

end tell

I used the Keyboard Shortcut trick to assign it Command-D. Now, when I come across a playlist that's in Playlist View, I can quickly toggle it to the way I prefer it.

* * *

Know what? Why should I have to wait to stumble onto a playlist I haven't yet set to my favorite View? CHANGE THEM ALL NOW!

I've added a repeat block that will reveal each user playlist. While each is thus selected, the View and Column Browser will be toggled. Just run this in Script Editor:

tell application "Music"

activate

repeat with i from 1 to (count of every user playlist)

delay 1

reveal user playlist i

try

tell application "System Events" to keystroke "s" using {command down, shift down}

end try

delay 0.2

try

tell application "System Events" to keystroke "b" using {command down}

end try

end repeat

end tell

...and run it once a week or thereabouts to keep all Playlists to View as Songs with the Column Browser.

If DIY'ing all this seems ridiculous, and it kind of is, you can download the scripts Playlist Manager and Playlist Views Manager which perform similar actions.

Site contents © 2001 - 2021 (that's right: 2001) Doug Adams and weblished by Doug Adams. Contact support AT dougscripts DOT com. About.
All rights reserved. Privacy.
AppleScript, iTunes, iPod, iPad, and iPhone are registered trademarks of Apple Inc. This site has no direct affiliation with Apple, Inc.
The one who says "it cannot be done" should not be interrupting the one who is doing it.