Hey guys,
I'm using Geektool to display song information for the current playing song, however, whenever Geektool is running this script it won't allow me to close iTunes. It will quit and reopen right away. In Snow Leopard this hangup wouldn't allow the system to shut down (because SL would close it and it'd open again interrupting the shut down) but would eventually shut down. Now in Lion it won't let me shut down my computer at all because iTunes keeps launching at the last second. Here is the code that I use to display the song information:
Can anyone point me to the line that is forcing iTunes to keep reopening?
I'm using Geektool to display song information for the current playing song, however, whenever Geektool is running this script it won't allow me to close iTunes. It will quit and reopen right away. In Snow Leopard this hangup wouldn't allow the system to shut down (because SL would close it and it'd open again interrupting the shut down) but would eventually shut down. Now in Lion it won't let me shut down my computer at all because iTunes keeps launching at the last second. Here is the code that I use to display the song information:
Code:
#!/bin/sh
if ps x | grep iTunes | grep -q -v grep; then
osascript -e 'tell application "iTunes"
set trackname to name of current track
set artistname to artist of current track
set albumname to album of current track
if albumname is null then
set albumshow to " "
else if albumname is "" then
set albumshow to " "
else
set albumshow to "" & albumname & ""
end if
set trackduration to duration of current track
set trackposition to player position
set elapsed to round (trackposition / trackduration * 100)
set myRating to round ((rating of current track) / 20)
if myRating is 1 then
set myRating to "* "
else if myRating is 2 then
set myRating to "** "
else if myRating is 3 then
set myRating to "*** "
else if myRating is 4 then
set myRating to "**** "
else if myRating is 5 then
set myRating to "***** "
else
set myRating to ""
end if
set myRating to myRating
set output to "" & trackname & "\n\n" & artistname & "\n\n" & albumshow & "\n" & myRating
end tell' | iconv -f utf-8 -t ucs-2-internal
fi
Can anyone point me to the line that is forcing iTunes to keep reopening?
Last edited: