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\" 
	playpause
	end tell"
else 
	run script "tell application \"iTunes\" 
	playpause
	end tell"
end if