iTunes support for notification center (song changes, etc.)

Blackened Apple

macrumors regular
Original poster
Jun 15, 2012
116
0
Hey everyone,

Can anyone tell me if iTunes sends out notifications for events like song changes?
 

Blackened Apple

macrumors regular
Original poster
Jun 15, 2012
116
0
Ok, thank you very much. I'd appreciate if it were available, other music apps have similar on-screen notifications...
 

tkermit

macrumors 68040
Feb 20, 2004
3,432
2,363
You could look for an app that sends out Growl notifications and then install Hiss, which converts them to proper ML notifications (no need for Growl to be installed).

 

heghead

macrumors member
May 30, 2010
33
0
Australia
I've created an app which uses AppleScripts and Terminal-Notifier (https://github.com/alloy/terminal-notifier) to display track names as notification centre notifications when the song changes.

I've put it all into a neat little application package for people to easily install and use themselves (see the instructions file inside the ZIP archive).

Here's the link to the ZIP file containing everything you need.

http://www.mediafire.com/?9h01wlo18ptly

Give it a go and let me know how it goes!
 

Attachments

Last edited:

nyolc8

macrumors regular
Jul 20, 2012
205
1
I've created an app which uses AppleScripts and Terminal-Notifier (https://github.com/alloy/terminal-notifier) to display track names as notification centre notifications when the song changes.

I've put it all into a neat little application package for people to easily install and use themselves (see the instructions file inside the ZIP archive).

Here's the link to the ZIP file containing everything you need.

https://www.dropbox.com/s/5h9ebi25ecl45c8/NowPlaying.zip

Give it a go and let me know how it goes!
I just Love it! :D Thank you!
 

hafr

macrumors 68030
Sep 21, 2011
2,743
5
I've created an app which uses AppleScripts and Terminal-Notifier (https://github.com/alloy/terminal-notifier) to display track names as notification centre notifications when the song changes.

I've put it all into a neat little application package for people to easily install and use themselves (see the instructions file inside the ZIP archive).

Here's the link to the ZIP file containing everything you need.

https://www.dropbox.com/s/5h9ebi25ecl45c8/NowPlaying.zip

Give it a go and let me know how it goes!
Wow, that was great, thanks a lot! But a reboot is not necessary :)

I compared it, and Hiss + Bowtie that I recommended took several hundred MB's of RAM, your app only uses 8,4 MB...
 

roland.g

macrumors 604
Apr 11, 2005
6,559
1,484
That's great. I might try that.

But my main question is does the notification go away or do you need to clear it.

One of my beef's with Notifications in iOS is that if it tells me I have new mail and then I read the new mail in the mail app independent of going through the notification to get to it, when I pull down the notification center later on my phone, it still shows. GameCenter does this a lot too. Once I read the mail item or delete it or whatever, I want notification center to be on the same page.

Maybe I have something set up wrong.

Will your app just keep producing a list of songs I needs to remove from the list?
 

nyolc8

macrumors regular
Jul 20, 2012
205
1
roland.g: notification dissapears automatically from the notification center as soon the music stopped or paused. :)
 

heghead

macrumors member
May 30, 2010
33
0
Australia
Will your app just keep producing a list of songs I needs to remove from the list?
Right before a new track notification is sent to Notification Centre, the previous one is removed. :)

I just Love it! :D Thank you!
Wow, that was great, thanks a lot! But a reboot is not necessary :)

I compared it, and Hiss + Bowtie that I recommended took several hundred MB's of RAM, your app only uses 8,4 MB...
Thanks for the positive feedback everyone! :)
 

Icy1007

macrumors 65816
Feb 26, 2011
1,041
63
Cleveland, OH
It seems that if I press forward or backwards multiple times it only shows an alert for the first song. I'd have to wait for the alert to disappear before pressing forward/backward for the next song to appear.

EDIT: Hmm, nm. It seems that it has an issue with some song names. Most songs prompt an alert, but some songs won't display an alert.

EDIT2: It seems a pattern of songs that have artists that start with a [ don't display an alert.

EDIT3: Yep, I removed the [ from the beginning of the artist and now it prompts an alert.

Just thought you'd want to know.
 
Last edited:

heghead

macrumors member
May 30, 2010
33
0
Australia
It seems that if I press forward or backwards multiple times it only shows an alert for the first song. I'd have to wait for the alert to disappear before pressing forward/backward for the next song to appear.

Hmm, nm. It seems that it has an issue with some song names. Most songs prompt an alert, but some songs won't display an alert.
I have the same issue. It's caused because of the way the script is written. I tested running the script continually (which would dramatically improve the responsiveness of the notifications) however instead of using 0.5%-2% CPU it used 30+% CPU.

As a compromise the script only runs once every second, dramatically decreasing resources needed, but slowing down the responsiveness of the notifications.

If you do have any songs in particular which don't show a notification, let me know what their names are and I can edit the script to fix it :)

EDIT: Okay, I'll look into a fix for the [ issue! Thanks!!
 

Icy1007

macrumors 65816
Feb 26, 2011
1,041
63
Cleveland, OH
Activity Monitor is reporting NowPlaying as using between 0.5% and 0.7% of my CPU (Max of 800%).

Does seem right? Just wondering.

EDIT: And it seems to be using more cpu% when no song is playing... using 1.0% when nothing is playing.

Anyway, it's not that big a deal 0.5-1.0 is nothing. Thanks for the script :)
 

Attachments

Last edited:

heghead

macrumors member
May 30, 2010
33
0
Australia
Activity Monitor is reporting NowPlaying as using between 0.5% and 0.7% of my CPU (Max of 800%).

Does seem right? Just wondering.
Yep, that looks fine to me, same as what I see most of the time :)

I'm looking into the bracket issue now - thanks so much for picking it up. I will have a revision uploaded in a few hours.
 

Icy1007

macrumors 65816
Feb 26, 2011
1,041
63
Cleveland, OH
Yep, that looks fine to me, same as what I see most of the time :)

I'm looking into the bracket issue now - thanks so much for picking it up. I will have a revision uploaded in a few hours.
I noticed only 2 of my 1000+ songs have a [ as the first character of the artist name. lol.

I just happened to play one of those two when I first started up NowPlaying.
 

bndoarn

macrumors 6502a
Mar 16, 2008
921
0
I've created an app which uses AppleScripts and Terminal-Notifier (https://github.com/alloy/terminal-notifier) to display track names as notification centre notifications when the song changes.

I've put it all into a neat little application package for people to easily install and use themselves (see the instructions file inside the ZIP archive).

Here's the link to the ZIP file containing everything you need.

http://www.mediafire.com/?9h01wlo18ptly

Give it a go and let me know how it goes!
Thank you so much for this. I spent hours trying to do this the other day (while also trying to learn how to write apple scripts) and I failed miserably. It functioned fine but the CPU usage was ridiculous. However, I did mange to write an applescript by myself that will open your app when iTunes opens and quit when iTunes quits, lol. Thank you again.
 

Icy1007

macrumors 65816
Feb 26, 2011
1,041
63
Cleveland, OH
Hi Everyone,

Please click the link below to download the new version of NowPlaying. It is now hosted on MediaFire so that I can monitor downloads and upload new versions easily.

New to v1.1:
  • Fixed Square Bracket bug - Thanks to Icy1007 for discovering the bug!

http://www.mediafire.com/?9h01wlo18ptly

Thanks. I took a look at your script. I like how you fixed the "Bracket Bug".
;)

EDIT: Not sure how adding a space before and/or after the symbol fixes it, but whatever works. lol
 

heghead

macrumors member
May 30, 2010
33
0
Australia
Thanks. I took a look at your script. I like how you fixed the "Bracket Bug".
;)

EDIT: Not sure how adding a space before and/or after the symbol fixes it, but whatever works. lol
Haha thanks :) The issue is actually with the terminal-notifier app I use to send the notifications, so there's no way I can fix it properly :(

I didn't actually add a space, I had to use a different unicode character which looks just like a square bracket with a space before it... lol it was the only solution which I could find which actually worked..
 

Icy1007

macrumors 65816
Feb 26, 2011
1,041
63
Cleveland, OH
Haha thanks :) The issue is actually with the terminal-notifier app I use to send the notifications, so there's no way I can fix it properly :(

I didn't actually add a space, I had to use a different unicode character which looks just like a square bracket with a space before it... lol it was the only solution which I could find which actually worked..
Oh, really? lol That's interesting.