on idle
tell application "System Events" to ¬
set exists_ to exists process "PandoraBoy"
if exists_ is false then
tell application "Airfoil"
quit
end tell
quit me
end if
set timercount to timercount + 1
return 10 -- checks every 10 seconds to see if app has been quit
end idle