#!/bin/sh
if ps x \
| grep [/]Applications/iTunes.app/Contents/MacOS/iTunes\ >/dev/null
then
        osascript - <<'OSASCRIPT'
        tell application "iTunes"
                set foo1 to name of current track
                set foo2 to player position
                set foo3 to duration of current track
                set foo4 to foo1 & " " & foo2 & "/" & foo3
        end tell
OSASCRIPT
fi