Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Loco.Dice

macrumors newbie
Original poster
Mar 8, 2008
6
0
Hi!

I have been searching the net for some nice scripts to display the current iTunes song in irssi. They all work fine but only when you run irssi locally.

In my case, irssi is running in a screen on a remote box. I am using it over ssh in the Terminal.

Is there a way to make some kind of applescript that will just paste the current iTunes track in the Terminal window?

Maybe some example script we can tweak for the output?
 

Loco.Dice

macrumors newbie
Original poster
Mar 8, 2008
6
0
Trying the best I can, still did not figure this out. Anyone who can help me?
 

krunk

macrumors regular
Jan 29, 2004
236
0
Here's a bash script for cli itunes control:
http://www.nada.kth.se/~larsc/work/C108694166/E20060203135343/index.html

The snippet of applescript to get the currently playing data:

artist=`osascript -e 'tell application "iTunes" to artist of current track as string'`;
track=`osascript -e 'tell application "iTunes" to name of current track as string'`;
album=`osascript -e 'tell application "iTunes" to album of current track as string'`;
echo "$artist: $track [$album]";

I made this into a zsh function

function iStatus() {
artist=`osascript -e 'tell application "iTunes" to artist of current track as string'`;
track=`osascript -e 'tell application "iTunes" to name of current track as string'`;
album=`osascript -e 'tell application "iTunes" to album of current track as string'`;
echo "$artist: $track [$album]";
}

To make an irssi script write a perl script that does the same for you using the IRSSI module or put it in a script and call it with /exec.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.