1

I want to display a current track title with Cocoa.

For now I could get the playing title with Scripting Bridge but I don't know how to get it just after a song is changed.

Is there any way I can hook a listener to iTunes without a timer.

Thank you.

Emmettoc
  • 137
  • 2
  • 8

1 Answers1

2

iTunes posts a distributed notification when the track changes. This question contains information about the notification you need to observe for, and you should be able to work out what you need to do from either the Python code in the accepted answer or the Objective-C code that the other answer links to.

Community
  • 1
  • 1
Peter Hosey
  • 95,783
  • 15
  • 211
  • 370
  • Thank you so much for your fast reply. – Emmettoc Oct 14 '10 at 08:10
  • Emmettoc: If you've found this answer to be correct, you should accept it as such by clicking on the checkmark, so that future readers of this question can know that at a glance. – Peter Hosey Oct 14 '10 at 08:18
  • Thank you for your advice. I checked. I have one more question. Do you know a notification for volume changed? Or should I post another question about it? Thank you. – Emmettoc Oct 14 '10 at 09:14
  • Emmettoc: You should post another question about that. – Peter Hosey Oct 14 '10 at 09:41