on is_running(appName)
	tell application "System Events" to (name of processes) contains appName
end is_running

set rdRunning to is_running("Rdio")

if rdRunning then
	run script "tell application \"Rdio\" 
	next track
	end tell"
else 
	run script "tell application \"iTunes\" 
	play next track
	end tell"
end if