Jump to content
caleb531

Play Song - Quickly play songs, albums, and more from iTunes

Recommended Posts

Introduction

 

With the introduction of Alfred v2.0, the built-in iTunes mini player is now the only way to interact with my iTunes library in Alfred. However, I would prefer to quickly search for and play songs without entering the mini player first. Therefore, I created Play Song—a workflow designed to make playing songs in iTunes extremely quick and convenient.

 

Download

 

Download Play Song (latest)

 

Usage

 

Play Song enables five keywords which allow you to search for and play songs in your iTunes library.

In order for Play Song to function properly, it requires access to assistive devices. You can enable this for Alfred via the Security & Privacy pane of System Preferences.

 

Playing a song
 
To play an individual song, use the playsong keyword. Songs whose names match your query will populate the list of results. Choosing a song from the list will play that song once.
 
Playing an album
 
To play all songs from a particular album, use the playalbum keyword. Albums whose names match your query will populate the list of results. Choosing an album from the list will play all songs from that album (ordered by track number).
 
Playing an artist
 
To play all songs by a particular artist, use the playartist keyword. Artists whose names match your query will populate the list of results. Choosing a artist from the list will play all songs by that artist (grouped by album).
 
Playing a genre
 
To play all songs within a particular genre, use the playgenre keyword. Genres whose names match your query will populate the list of results. Choosing a genre from the list will play all songs within that genre (grouped by artist).
 
Playing a playlist
 
To play all songs within a particular playlist, use the playplaylist keyword. Non-empty playlists whose names match your query will populate the list of results. Choosing a playlist from the list will play all songs within that playlist (according to playlist order).

 

Support

 

If you have a bug to report or a feature to request, please submit an issue on GitHub.

 

Release Notes

 

Release notes for the workflow are also available on GitHub.

Edited by caleb531

Share this post


Link to post

this is great! thanks  :)

would it be possible to include podcasts?

 

Sure! I've updated the script with an option (called podcastsIncluded) that will enable the showing of podcasts in the results.

-Caleb

Share this post


Link to post

Very useful workflow, powerful and saves a heck of a lot of time finding songs in finder or itunes. Plus the features I haven't even played with yet. Nice one thanks for sharing!

Share this post


Link to post

This is great! Would it also be possible to search for and play artists and albums? I would love that!

 

Not sure about that. I think with AppleScript, I can only search and play songs, not artists or albums. Either way, I would prefer to have only songs show in the results for the sake of simplicity.

 

-Caleb

Share this post


Link to post

When I search for a song, the results are found (and filtered) also by album or artist.

 

Is it possible to separate it?

 

play song "x" - would look for songs named "x" only

play artist "y" - would look for artists named "y" only

play album "z" - would look for albums named "z" only

 

BTW, the best like you said is to have only songs, but I believe also only to search by the song name.

 

It's a great workflow and very useful. Congrats!

Share this post


Link to post

When I search for a song, the results are found (and filtered) also by album or artist.

 

Is it possible to separate it?

 

play song "x" - would look for songs named "x" only

play artist "y" - would look for artists named "y" only

play album "z" - would look for albums named "z" only

 

BTW, the best like you said is to have only songs, but I believe also only to search by the song name.

 

It's a great workflow and very useful. Congrats!

 

No, it's really not possible, AFAIK, AppleScript only lets you play a track, not an artist (nor an album, for that matter).

 

-Caleb

Edited by caleb531

Share this post


Link to post

Maybe I didn't explain myself very good...

 

What I meant is not to play an artist or album.

 

What is mean is that your search, is filtering also by artist and album name (and not only by song name).

 

So for example when I search for Foo Fighters, it shows me all songs from Foo Fighters (even though they have no "Foo Fighters" in their song name).

 

What I think would be nice is to search *only* the song name for whatever string you put. So if for example, there is no song named Foo Fighters, the previous example would return blank (instead of all songs from the band Foo Fighters).

 

Thanks

Share this post


Link to post

Maybe I didn't explain myself very good...

 

What I meant is not to play an artist or album.

 

What is mean is that your search, is filtering also by artist and album name (and not only by song name).

 

So for example when I search for Foo Fighters, it shows me all songs from Foo Fighters (even though they have no "Foo Fighters" in their song name).

 

What I think would be nice is to search *only* the song name for whatever string you put. So if for example, there is no song named Foo Fighters, the previous example would return blank (instead of all songs from the band Foo Fighters).

 

Thanks

I second that. In addition to "play" perhaps there can be "band" and/or "song" keywords, that they will show a list of songs by the artist or the song you're searching for, and the next step would be as with "play", to play it.

Share this post


Link to post

Anyone know if it's possible to add songs to "Play Next" or "Up Next" in iTunes. I've been screwing around with it and the only seems to be through GUI scripting (blech). Would love to queue up the next song rather than play immediately.

 

Awesome workflow though! I like it a bit more than the mini-player (no offense Alfred!).

Share this post


Link to post

Maybe I didn't explain myself very good...

 

What I meant is not to play an artist or album.

 

What is mean is that your search, is filtering also by artist and album name (and not only by song name).

 

So for example when I search for Foo Fighters, it shows me all songs from Foo Fighters (even though they have no "Foo Fighters" in their song name).

 

What I think would be nice is to search *only* the song name for whatever string you put. So if for example, there is no song named Foo Fighters, the previous example would return blank (instead of all songs from the band Foo Fighters).

 

Thanks

 

Hmm, I'm not sure I like the sound of that. I would prefer to get some results as opposed to no results, as long as the results maintain their relevance (in which case, they usually will). Besides, I would imagine that iTunes orders songs with titles matching the query above songs with artists matching the query (if that makes sense).

 

The goal of the workflow is to make the action of playing an iTunes song as quickly and easily as possible. Therefore, I believe the app should include whichever results are relevant to the search query. Now, I realize that I could make this an option rather than the default behavior, but I would much prefer to preserve the simplicity of the workflow. Given all of the acclaim it has received in the above posts, I believe that it has accomplished its aforementioned goal, and therefore doesn't need any significant additions.

 

I second that. In addition to "play" perhaps there can be "band" and/or "song" keywords, that they will show a list of songs by the artist or the song you're searching for, and the next step would be as with "play", to play it.

 

Again, for the reasons listed above, I don't plan of adding such a feature. Even more so, I wouldn't add such a feature because it would require creating multiple "Filter" scripts, with much of the same codebase and a few minor changes. That solution is not very DRY, if you ask me.

 

-Caleb

Share this post


Link to post

Thanks for this Caleb. The addition of podcasts is great. Is there any way that audiobooks could also be activated as well?.

 

Sure, I will consider adding audiobook support. I will post here if I do.

-Caleb

Edited by caleb531

Share this post


Link to post

This addon is awesome! One question though. If you search for an album name is there any way to have results sorted by track number instead of alphabetically?

 

I'm not sure about that. The script internally uses iTunes's search function in AppleScript to find songs matching the given query. Therefore, because iTunes determines the order of its own search results, I cannot sort songs by track number without sacrificing script performance (which is important to me).

 

-Caleb

Edited by caleb531

Share this post


Link to post

I'm not sure about that. The script internally uses iTunes's search function in AppleScript to find songs matching the given query. Therefore, because iTunes determines the order of its own search results, I cannot sort songs by track number without sacrificing script performance (which is important to me).

 

-Caleb

That makes sense. Ok well it was worth at least asking. Again it works flawlessly. Thank you!

Share this post


Link to post

Great workflow, but it doesn't seem to find all songs / artists / albums.

 

For example, if I search for the album "One For The Road" by Ocean Colour Scene, which is correctly tagged in my library as shown:-

 

NFeJQ0I.png

 

Then the workflow cannot find it, either by artist or album, and reverts back to the fallback searches:-

 

RMtjE9X.png

Edited by judgejohn82

Share this post


Link to post

Great workflow, but it doesn't seem to find all songs / artists / albums.

 

For example, if I search for the album "One For The Road" by Ocean Colour Scene, which is correctly tagged in my library as shown:-

 

Then the workflow cannot find it, either by artist or album, and reverts back to the fallback searches:-

 

Okay, I pushed a new version of the plugin with a potential fix. Let me know if it works for you.

 

-Caleb

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...