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

Discussion in 'OS X Mountain Lion (10.8)' started by Blackened Apple, Aug 4, 2012.

  1. macrumors regular

    Joined:
    Jun 15, 2012
    Messages:
    115
    #1
    Hey everyone,

    Can anyone tell me if iTunes sends out notifications for events like song changes?
     
  2. macrumors 68030

    tkermit

    Joined:
    Feb 20, 2004
    Messages:
    2,651
    #2
    It doesn't.
     
  3. macrumors regular

    Joined:
    Jun 15, 2012
    Messages:
    115
    #3
    Ok, thank you very much. I'd appreciate if it were available, other music apps have similar on-screen notifications...
     
  4. macrumors 6502a

    Blaine

    Joined:
    Dec 3, 2007
    Messages:
    685
    Location:
    Abilene TX
    #4
    Yeah, this would be pretty cool.
     
  5. macrumors 68030

    tkermit

    Joined:
    Feb 20, 2004
    Messages:
    2,651
    #5
    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).

    [​IMG]
     
  6. macrumors 68030

    Joined:
    Sep 21, 2011
    Messages:
    2,742
    #6
    Install Hiss, then install Bowtie. http://bowtieapp.com

    Tada.
     
  7. heghead, Aug 6, 2012
    Last edited: Aug 7, 2012

    macrumors member

    Joined:
    May 30, 2010
    Messages:
    33
    Location:
    Australia
    #7
    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!
     

    Attached Files:

  8. macrumors regular

    Joined:
    Jul 20, 2012
    Messages:
    205
    #8
    I just Love it! :D Thank you!
     
  9. macrumors 68030

    Joined:
    Sep 21, 2011
    Messages:
    2,742
    #9
    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...
     
  10. macrumors 603

    roland.g

    Joined:
    Apr 11, 2005
    Messages:
    5,646
    Location:
    One mile up and soaring
    #10
    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?
     
  11. macrumors regular

    Joined:
    Jul 20, 2012
    Messages:
    205
    #11
    roland.g: notification dissapears automatically from the notification center as soon the music stopped or paused. :)
     
  12. macrumors member

    Joined:
    May 30, 2010
    Messages:
    33
    Location:
    Australia
    #12
    Right before a new track notification is sent to Notification Centre, the previous one is removed. :)

    Thanks for the positive feedback everyone! :)
     
  13. Icy1007, Aug 7, 2012
    Last edited: Aug 7, 2012

    macrumors 6502a

    Joined:
    Feb 26, 2011
    Messages:
    939
    Location:
    Las Vegas, NV
    #13
    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.
     
  14. macrumors member

    Joined:
    May 30, 2010
    Messages:
    33
    Location:
    Australia
    #14
    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!!
     
  15. Icy1007, Aug 7, 2012
    Last edited: Aug 7, 2012

    macrumors 6502a

    Joined:
    Feb 26, 2011
    Messages:
    939
    Location:
    Las Vegas, NV
    #15
    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 :)
     

    Attached Files:

  16. macrumors member

    Joined:
    May 30, 2010
    Messages:
    33
    Location:
    Australia
    #16
    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.
     
  17. macrumors 6502a

    Joined:
    Feb 26, 2011
    Messages:
    939
    Location:
    Las Vegas, NV
    #17
    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.
     
  18. macrumors member

    Joined:
    May 30, 2010
    Messages:
    33
    Location:
    Australia
    #18
    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
     
  19. macrumors member

    Joined:
    Jun 14, 2012
    Messages:
    84
    #19

    Perfect!
     
  20. macrumors 6502a

    Joined:
    Mar 16, 2008
    Messages:
    921
    #20
    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.
     
  21. macrumors 6502a

    Joined:
    Feb 26, 2011
    Messages:
    939
    Location:
    Las Vegas, NV
    #21

    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
     
  22. macrumors member

    Joined:
    May 30, 2010
    Messages:
    33
    Location:
    Australia
    #22
    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..
     
  23. macrumors regular

    Joined:
    Apr 13, 2010
    Messages:
    124
    Location:
    Brisvegas
    #23
    And this is why I love this community! Thanks!
     
  24. macrumors 6502a

    Joined:
    Feb 26, 2011
    Messages:
    939
    Location:
    Las Vegas, NV
    #24
    Oh, really? lol That's interesting.
     
  25. macrumors 68030

    aziatiklover

    Joined:
    Jul 12, 2011
    Messages:
    2,545
    Location:
    8.8.8.8 and 8.8.4.4
    #25
    Pretty epic! Thanx
     

Share This Page