Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to sync my Last.FM last played track with my iChat status... right from the command line. I've come this far:

curl -s |
    grep -m 1 -E -e "         <title>(.*)</title>.*" |
    sed "s/.*<title>//" |
    sed "s/<\/title>//"

which results in the currently or last played track like

The Black Seeds – Cracks In Our Crown

Is there a way to forward this string as the iChat / Messages status now?

share|improve this question
up vote 1 down vote accepted

Just found it myself... format the output of sed as AppleScript and call osascript...

curl -s |
    grep -m 1 -E -e "         <title>(.*)</title>.*" |
    sed "s/.*<title>/tell application \"Messages\" to set the status message to \"♬  /" |
    sed "s/<\/title>/\"/" |
    sed "s/\&amp;/\&/" |

That's it!

share|improve this answer
minor improvement - replaceing &amp; with & : – Daniel Bleisteiner Aug 16 '12 at 13:04
Answer is updated – patrix Aug 16 '12 at 18:34

This is waaaay too long to try and summarise into an answer here, but there is a really cool script that was written to do the same thing but with iTunes here.

Should give you what you need :-)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.