Okay, notification is a breeze.
iTunesRater now has two new features:
- Doesn’t poll, waits for notification from iTunes (requires 4.7.1)
- Volume Adjustment
Instead of polling iTunes every 5 seconds, the information is only checked when iTunes sends a general notification to the NotificationCenter. This should mean less CPU use, not that I was using much anyway. To get this to work well, I had to notify the AppleScript that a change had been made, by ‘pressing’ one of the interface items. Slightly unorthodox, but effective.
Also, a few of my CDs are softer than the rest, I now have a volume adjustment slider on the left hand side that can be used to modify the volume of the current track - don’t use this as your master iTunes volume, it writes the data into your library, so that track will become louder or softer each time you play it.
I might actually make this into a fully-fledged iTunes Controller, with AutoRating features.
Later. Time to sleep.
Hy, my Name ist Christoph. I have a question about iTunesRater . How does iTunesRater recognizeses that iTunes is playing an new song. I’ve seen your applescript but I don’t know anything about the events. Can you give me a hint, or a resource where you got your informations how the self-notification in iTunes work?
Why I am asking? Yes, I’m in summerterm on the Bauhaus-University in Weimar, Germany and we develop applescript softwaresensors for our project.
Thanks a lot - Christoph
2 months, 2 weeks after the fact.
Guten Tag,
In a recent version of iTunes (I can’t remember which), Apple introduced notification.
This means a message is sent to a server (in the software sense, not a seperate computer), and it is possible to set up programs to receive these events.
To do this with an AppleScript is not possible (or at least, I couldn’t do it), but to do it with an AppleScript Studio application is. But it is a bit tricky.
You’ll need the source for iTunesRater, and you’ll need to examine the non-applescript code. It took me a few hours to figure out, but it is quite simple, you just need to know what to do.
I’ll post a more detailed description, including the source code soon. Maybe this weekend, but I am pretty busy.
2 months, 2 weeks after the fact.
Thank you for answering. Okay, it would be pretty nice if you could setup a detailed description. I now have programmed some queryes on iTunes, some really simple ones, like current title, etc… thx Christoph
2 months, 3 weeks after the fact.
I’ve put up a short tutorial on how to use the Notification feature of OSX to find out when iTunes track has changed, and run an AppleScript then.
I use the applescript that is run to notify a running AppleScript Studio Program to update it’s display. You could use it to do anything.
2 months, 3 weeks after the fact.