AppleScript - iTunes, Terminal and Evocam

November 05, 2006

Here is a quick and dirty script that I wrote to take the current artist and track playing in iTunes and send it to a Terminal session:

tell application "iTunes"
    set _artist to artist of current track
    set _track to name of current track
end tell

set the clipboard to _artist & " - " & _track
set info to the clipboard

tell application "Terminal"
    do script info in window 1
end tell

And here is a script to display the same thing in an Evocam caption:

tell application "iTunes"
    set _artist to artist of current track
    set _track to name of current track
end tell

tell application "EvoCam"
    set webcam item "iTunes" to _artist & " - " & _track
end tell