Florian Posted February 9, 2013 Posted February 9, 2013 Hey beautiful people, It's been a while since I haven't posted anything. Mainly because what I was developing wouldn't have interested anyone Oh and also, you know, sometimes I actually work. But here is a little piece of code that might help some of you: something to feed back into Alfred the current playing track (name and artist) and it's rating. As well as some basic controls. I'm pretty sure it'd be very easy to tweak for most of you because I'm using some applescript within the bash script (thank you osascript hook =D). So please, feel free to steal that and make it awesome. Go crazy ! http://dl.dropbox.com/u/14050630/iTunes%20control.alfredworkflow (also available on AlfPT) cheers
tsvoronos Posted February 9, 2013 Posted February 9, 2013 Very cool! I wonder if this script can be leveraged to do something like share the title/album of my current track on twitter/facebook. What do you think?
Florian Posted February 9, 2013 Author Posted February 9, 2013 Very cool! I wonder if this script can be leveraged to do something like share the title/album of my current track on twitter/facebook. What do you think? It's definitely doable. But I'm not going to do it :-] GamerChase 1
jdfwarrior Posted February 9, 2013 Posted February 9, 2013 Sharing on Twitter will be part of AlfredTweet when I release it. Still trying to figure out what all functionality I want in it. I have basic things done like, following/unfollowing people, tweeting, and the NowPlaying stuff.
Carlos-Sz Posted February 10, 2013 Posted February 10, 2013 I made a script to preview what would be the next song into Alfred:
Carlos-Sz Posted February 10, 2013 Posted February 10, 2013 OK. I’ve finished the previous script too (with it into Alfred). I’ll fine tune them and I’ll create a new topic. Note: iTunes 11 “song repeat” and “shuffle” commands are broken*. I can’t get them so this script can’t tell precisely the information considering those two iTunes features. *http://dougscripts.com/itunes/2012/11/itunes-11-applescript-bug/
Florian Posted February 10, 2013 Author Posted February 10, 2013 So that's nice and all but maybe you could give us a link?
Carlos-Sz Posted February 10, 2013 Posted February 10, 2013 So that's nice and all but maybe you could give us a link? Right now the code works when a playlist is playing. There are things to do yet but here is the code so far: http://dl.getdropbox.com/u/127623/Itunes%20up%20next.alfredworkflow Any help is welcomed. I’ll post here the progress. If any.
twinpeaks Posted February 10, 2013 Posted February 10, 2013 As always nice work Florian. It would be nice to get notifications with info of musician/album/song title on track change. Cover art if possible would also be cool but probably a lot of work. Thanks for sharing! Check your messages btw...
Florian Posted February 10, 2013 Author Posted February 10, 2013 Right now the code works when a playlist is playing. There are things to do yet but here is the code so far: http://dl.getdropbox.com/u/127623/Itunes%20up%20next.alfredworkflow Any help is welcomed. I’ll post here the progress. If any. It'd be pretty cool if you could get it to work when shuffle is on as well.
Carlos-Sz Posted February 10, 2013 Posted February 10, 2013 It'd be pretty cool if you could get it to work when shuffle is on as well. I made some research and right now iTunes 11 is not responding to shuffle or repeat. It’s a bug. But it seems to be very difficult to get the sequence of songs when played from the “Music” library. For now (and unfortunately), the “up next” and “previous” will work only when a playlist is playing.
Carlos-Sz Posted February 10, 2013 Posted February 10, 2013 I was able to “manually” get the album songs based on the current track. The efficiency of this method will depend on how organized the library is because it is based on artist and album tags. Tomorrow I’ll test the code in a workflow…
Carlos-Sz Posted February 10, 2013 Posted February 10, 2013 Any help for improvements will be appreciated. In resume: - The workflow works well with a custom playlist. - Song playing from Library is another story: iTunes does not provide a way to get the order of playing songs (even with shuffle off) iTunes does not provide a way to get a list of the songs from current album - Right now the workflow can get a list of songs from current album (but not from an Album with “Various” as album artist) - Sometimes or for some tracks the code inside Alfred does not work though it works in AppleScript Editor I know there are a lot of missing things regarding a song playing from Library but a song from Library can be skipped making the workflow a simple next/prev. Download the updated version here: http://dl.getdropbox.com/u/127623/Itunes%20up%20next.alfredworkflow
Florian Posted February 10, 2013 Author Posted February 10, 2013 Sweet! I like that! Any chance you could add the artist (or show if tv show) next to the track name? It'd really help understand what's actually next (or previous).
Carlos-Sz Posted February 10, 2013 Posted February 10, 2013 Sweet! I like that! Any chance you could add the artist (or show if tv show) next to the track name? It'd really help understand what's actually next (or previous). Yes, I think it is possible. Thank you for your suggestion.
Carlos-Sz Posted February 10, 2013 Posted February 10, 2013 A new version with a lot of improvements: http://dl.getdropbox.com/u/127623/Itunes%20up%20next.alfredworkflow Now it includes artist as suggested by Florian. Florian 1
CarlosNZ Posted February 18, 2013 Posted February 18, 2013 I don't even know if this is possible, but can the icon be the album cover art?
sr_navarre Posted March 15, 2013 Posted March 15, 2013 How would I use part of this workflow to search (either Google or a specific site) for the lyrics of the currently playing song?
Florian Posted March 15, 2013 Author Posted March 15, 2013 Within the "script filter" named "rate" in this workflow, you will find the code that gives you the title and the artist of the track currently playing. I don't know exactly what you want to do with the lyrics (open in browser, save in .txt, add to track metadata, paste to clipboard...) so depending on that there are several approaches you might want to take. Say you want to add that to the track's metadata. First, I'd pass the title and artist as arguments (in the xml output) to a second script (thus replacing the current NSAppleScript) that would get (and parse) the lyrics form a predefined website. I'd recommend you use php for that part as it's very good at dealing with websites but anything would do. Second, I'd pass the lyrics you've obtained to a final script. I recommend you use Apple Script as it'll make it really easy for you to set the tracks metadata to the lyrics you've just passed. Any question? have fun
sr_navarre Posted March 15, 2013 Posted March 15, 2013 Within the "script filter" named "rate" in this workflow, you will find the code that gives you the title and the artist of the track currently playing. I don't know exactly what you want to do with the lyrics (open in browser, save in .txt, add to track metadata, paste to clipboard...) so depending on that there are several approaches you might want to take. Say you want to add that to the track's metadata. First, I'd pass the title and artist as arguments (in the xml output) to a second script (thus replacing the current NSAppleScript) that would get (and parse) the lyrics form a predefined website. I'd recommend you use php for that part as it's very good at dealing with websites but anything would do. Second, I'd pass the lyrics you've obtained to a final script. I recommend you use Apple Script as it'll make it really easy for you to set the tracks metadata to the lyrics you've just passed. Any question? have fun Thanks. I'm a total beginner at any sort of coding, but I'll take this and give it a try.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now