I'm trying to use AppleScript to fast forward YouTube videos by 10 seconds in Chrome, but the following code doesn't work; I get missing value as output, instead. What I am doing wrong?

tell application "Google Chrome"
    repeat with t in tabs of windows
        tell t
            if URL starts with "http://www.youtube.com/watch" or URL starts with "https://www.youtube.com/watch" then
                execute javascript "
            var player = document.querySelector('video');
            player.seekTo(player.getCurrentPosition() + 10000);
                exit repeat
            end if
        end tell
    end repeat
end tell
  • Firstly, welcome to Ask Different! :) I hope you come to find this site has a lot to offer! In case you haven't already, it's worth taking the time to read the tour. All the best with your question. – Monomeeth Sep 16 '19 at 3:54

You must log in to answer this question.

Browse other questions tagged .