An iTunes Monitor for MoodBlast
Note: This post is over 6 months old. You may want to check later in this blog to see if there is new information.
The following links are auto-generated but may help you locate newer content:
A better solution: Proxi from Griffin has a built in iTunes monitor with lots of other fun stuff. You can just trigger a basic applescript on track change that sends “^s Rocking out to !itune”, replacing ^s with whatever services it should blast to. If you run “if player state is playing” in a “tell application “iTunes”” block, you can add an else statement that sends “^s !blank” to clear your mood message when iTunes stops. My custom solution below is annoying compared to how well this works.
I whipped up a quick Applescript that you can edit to your tastes and save as an application. It will monitor iTunes for track changes and send a blast with !itune. You can edit parameters to blank your status when the music stops and set what services to update at the top of the script. If you know a little Applescript, you have a lot of possibilities. Change the delays, add some custom string formatting, even set a status based on iTunes state. You could use iTunes to set your available/away status by sending an @keyword in an if/else block. Here’s the rough idea…
TuneBlast.app
-- TuneBlast by Brett Terpstra-- Monitors iTunes for track changes and sends track-- info with MoodBlast---- If iTunes isn't loaded it cycles checks every 30 seconds-- If iTunes is loaded but not playing it cycles every 15 seconds-- If iTunes is playing it cycles every 5 seconds looking for track changes---- Use the first letter of a service to select it below-- escept for Tumblr, which is "U"set blastTo to "si" -- Blast to (s)kype and (i)Chatset blankWhenNotPlaying to true -- Blank selected services when music stopsglobal theTrack, blankedStatusset {theTrack, blankedStatus} to {null, false}repeattell application "System Events" to get the name of every processif the result contains "iTunes" thentell application "iTunes"if player state = playing thenif current track is not equal to theTrack thenset theTrack to current tracktell application "MoodBlast" to blast "^" & blastTo & " !itune"if blankedStatus is true then set blankedStatus to falseend ifset theDelay to 5elseif blankWhenNotPlaying is true and blankedStatus is false thentell application "MoodBlast" to blast "^" & blastTo & " !blank"set blankedStatus to trueend ifset theDelay to 15end ifend tellelseset theDelay to 30end ifdelay theDelayend repeat- Download this code: tuneblast.txt
Have some fun, it’s just an example of what doors the new Applescript support in MoodBlast opens up. I didn’t test for too long, but it appears that the CPU hit is pretty minimal if you leave this running. The biggest drawback right now is having to force quit the app. If you know a better way to do this, please share! I’m hoping that a few scripts will pop up to enhance MoodBlast without forcing more feature bloat. Regardless, have fun. 
Have your say
XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>
No comments
Jump to comment form | comments rss [?] | trackback uri [?]