Trying to set a F8 pause/play dictation command
Separated the two applications into two separate dictation commands using applescript in automator. The latter controls the Youtube video on the tab Chrome last interacted with, which is essentially perfect.

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

if is_running("iTunes") then
    tell application "iTunes"
        playpause
    end tell
else if is_running("Spotify") then
    tell application "Spotify"
        playpause
    end tell
end if


to clickClassName(theClassName, elementnum)
    tell application "Google Chrome" to (tabs of window 1 whose URL contains "youtube")
    set youtubeTabs to item 1 of the result
    tell application "Google Chrome"
        execute youtubeTabs javascript "document.getElementsByClassName('" &amp; theClassName &amp; "')[" &amp; elementnum &amp; "].click();"
    end tell
end clickClassName    

clickClassName("ytp-play-button ytp-button", 0)

--clickClassName("ytp-prev-button ytp-button", 0)
--clickClassName("ytp-next-button ytp-button", 0)