Jump to content
Carlos-Sz

Add Current Song to an iTunes Playlist (or Build Playlists) 2.0

Recommended Posts

Overview

Add current iTunes song to a selected playlist or select or create a playlist and add songs to it.

Usage

Type the keyword addto and select a playlist to add the current iTunes song to it.

atp.png

Or type the keyword addto, highlight a playlist, press Command key then Return key to add any song from your library to the selected playlist:

atp_2.png

atp_3.png

The last selected playlist will always be used if you e.g. use the hotkey to add the current song to it without any interaction.

Download

  • Release date: 26 Feb 2014
  • OSX 1.9.2
  • iTunes 11.1.4
  • Alfred 2.1.1
  • Download Now
What's New
  • Rewritten to take advantage of all Alfred 2.1 AppleScript improvements
  • Support to iCloud songs (thanks to Katie)
  • Add songs to a playlist by using Command key (thanks to Katie)
  • Hotkey to add the current song to the last playlist
  • Hotkey to show the workflow
  • Create a new playlist if it is not found
  • Start and play iTunes if necessary
I would like to thanks Katie for all her help and great suggestions: THANK YOU!! :) Edited by Carlos-Sz

Share this post


Link to post

Thanks. This is great. I've been wanting to make something like this for a little while now.

 

Great. I’m about to make new playlists so I did this little workflow.

 

In addition, here is a new version:

 

- current playlist is not added to Alfred window

- the song will be added only if it does not exist in the selected playlist

 

Download: http://dl.getdropbox.com/u/127623/Add%20to%20Playlist.alfredworkflow

Share this post


Link to post

Hi Carlos,

 

Thank you for this workflow. I use the TJN's extension on alfed v1 it one of the things that i cant live without in my workflow. Any plans to add growl support?

 

Alfred supports Growl so it’s just a matter of a small workflow change:

 

 

1. Open Alfred Preferences
2. Go to Workflows
3. Select Add to Playlist
4. Double click Post Notification (it’s the red dot at right)
5. Now click Output to and select Growl
6. Click Save and it should work
 
Let me know if you need any help. 

Share this post


Link to post

This is great... but it doesn't work for iTunes Match songs that are not downloaded. 

 

I’ll see if I can find how iTunes handles such files. Thanks. 

Edited by Carlos-Sz

Share this post


Link to post

I updated add.scpt to work with any track in iTunes (in my library anyway — including iTunes Match tracks located in iCloud).

on run argv
	set sArgv to argv as text
	tell application "iTunes"
		set myList to sArgv
		set current_track to the current track
		set sTrack to name of current_track
		set sArtist to artist of current_track
		--check if in playlist
		set sListTracks to name of tracks of playlist myList as list
		if sListTracks contains sTrack then
			return "\"" & sTrack & "\"" & " is already in " & "\"" & myList & "\""
		else
			set currentList to playlist myList
			duplicate current_track to currentList
			return "\"" & sTrack & "\"" & " added to " & "\"" & myList & "\""
		end if
	end tell
end run

Share this post


Link to post

 

I updated add.scpt to work with any track in iTunes (in my library anyway — including iTunes Match tracks located in iCloud).

on run argv
	set sArgv to argv as text
	tell application "iTunes"
		set myList to sArgv
		set current_track to the current track
		set sTrack to name of current_track
		set sArtist to artist of current_track
		--check if in playlist
		set sListTracks to name of tracks of playlist myList as list
		if sListTracks contains sTrack then
			return "\"" & sTrack & "\"" & " is already in " & "\"" & myList & "\""
		else
			set currentList to playlist myList
			duplicate current_track to currentList
			return "\"" & sTrack & "\"" & " added to " & "\"" & myList & "\""
		end if
	end tell
end run

 

Thank you for the code. I’ll check the workflow later this week.

Share this post


Link to post

Version 2.0 is Out!

  • Release date: 26 Feb 2014
  • OSX 1.9.2
  • iTunes 11.1.4
  • Alfred 2.1.1
  • Download Now

What's New

  • Rewritten to take advantage of all Alfred 2.1 AppleScript improvements
  • Support to iCloud songs (thanks to Katie)
  • Add songs to a playlist by using Command key (thanks to Katie)
  • Hotkey to add the current song to the last playlist
  • Hotkey to show the workflow
  • Create a new playlist if it is not found
  • Start and play iTunes if necessary

I would like to thanks Katie for all her help and great suggestions: THANK YOU!!  :)

Share this post


Link to post

Thanks a lot for this workflow. I never used to have playlists I really enjoyed before it, and it revolutionized my use of them as I can incorporate my favorite songs while working.

 

I’m really glad the workflow is useful for you. Thank you.

Share this post


Link to post

Hi,

 

I was using the older version of this workflow and had it working in Yosemite, but I accidentally overwrote it with the newer version which doesn't seem to work due to a change to the behavior of System Events. Any chance there is a copy of the older pre 2.0 workflow around somewhere that I could use?

 

Thanks!

Share this post


Link to post

Hi,

 

I was using the older version of this workflow and had it working in Yosemite, but I accidentally overwrote it with the newer version which doesn't seem to work due to a change to the behavior of System Events. Any chance there is a copy of the older pre 2.0 workflow around somewhere that I could use?

 

Thanks!

 

I’ll update it ASAP.

 

Anyway, you can download version 1.0 here.

Share this post


Link to post

Thanks for the help! With the code above for to get it working with iCloud and the older version it is working for me in Yosemite. 

 

I'll look out for the update for 2.0 when its ready. 

Share this post


Link to post

Hi, I really like this Workflow. Even if it is quite old, it still works with the current OS X (10.11.5), iTunes (12.4) and Alfred (2.8.4) for songs in my iTunes library.

 

But it does not add songs to the playlist if the song is a Apple Music streamed song.

I don't know how to correct this.

Can any body help please?

 

Thanks, Mike 

Share this post


Link to post

Hi, I really like this Workflow. Even if it is quite old, it still works with the current OS X (10.11.5), iTunes (12.4) and Alfred (2.8.4) for songs in my iTunes library.

 

But it does not add songs to the playlist if the song is a Apple Music streamed song.

I don't know how to correct this.

Can any body help please?

 

Thanks, Mike 

 

 

Unfortunately I don’t use Apple Music.

 

I hope someone else can help us here.

Share this post


Link to post

Hi Mike,

 

I'm not the developer but understand the workflow of this program, I've used it for years.

 

Think of apple music like pandora, A streaming music service. With that in mind your not playing music you own, just a stream a music that pandora or in this case apple has selected for you with your help.

 

With that being said, streaming programs cant be added to a playlist as its not actual songs, just a connection to their server playing music for you.

 

Great Question,

 

Chris G

Share this post


Link to post

I don't think this is like pandora, its more like spotify or tidal in which you can stream individual songs. You can definitely add apple music streamed songs to playlists through the UI, but I don't know what can done through scripting.

 

The alfred mini player for iTunes also doesn't do well with apple music songs currently, so I'm guessing some api/applescript entry points for that may not be available. 

 

That being said, if you add a song from apple music to your library even if you don't download it this plugin appears to work, unfortunately that doesn't allow you to listed to a curated playlist or radio station and pick out songs as they come up to add to a playlist...

Share this post


Link to post

Is this one dead?

 

Won't work for me with OS X 10.11.5, iTunes 12.4.3.1, Alfred 3.1.1, Add to Playlist 2.0.

 

States "Loading playlists..." and then won't load them or let you search to find one.

Edited by petebocken

Share this post


Link to post

I did a clean install (but I synced my Alfred settings) and it broke this workflow :( I got this error in debugging mode:

[2016-10-07 09:13:03][ERROR: input.scriptfilter] Code 1: 0:90: execution error: mkdir: /Users/katie/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data: No such file or directory (1)

I tried to change the scripts to point to Alfred-3, but that was not enough to fix the error. So I tried to re-install but the download link is missing :unsure:

 

I'm going to dig through my backups to try and get it back, but I thought I would post because people are missing out on this awesome workflow!

Share this post


Link to post
On 03/10/2016 at 9:00 PM, petebocken said:

Is this one dead?

 

Won't work for me with OS X 10.11.5, iTunes 12.4.3.1, Alfred 3.1.1, Add to Playlist 2.0.

 

States "Loading playlists..." and then won't load them or let you search to find one.

 

Doesn't work for me also on 10.12.4 with iTunes 12.6.0.100 ... No playlists are showing up, it just goes to normal search

 

Please if you could fix this would be great, or make it open source so someone else could

 

Cheers. :)

 

Share this post


Link to post
On 4/1/2017 at 10:27 AM, humancopy said:

 

Doesn't work for me also on 10.12.4 with iTunes 12.6.0.100 ... No playlists are showing up, it just goes to normal search

 

Please if you could fix this would be great, or make it open source so someone else could

 

Cheers. :)

 

I second this! Would really love to be able to add songs to specific playlists.

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...