rewind/forward 10s youtube music/now playing?

I want a shortcut that'll allow me to rewind/fw the music by 10 seconds. mediamate does that but idk how.

I tried with a basic shortcut which works on ios but not on macOS

I think currently the easiest way is via Apple Script. I might be able to add a dedicated action for rewind/forward, but I'll need to look into that.

tell application "Google Chrome"
        repeat with w in windows
                repeat with t in tabs of w
                        if URL of t contains "music.youtube.com" then
                                execute t javascript "document.querySelector('video').currentTime += 10"
                                return
                        end if
                end repeat
        end repeat
end tell
  • To rewind, use -= 10 in a second trigger.
  • Chrome needs View → Developer → Allow JavaScript from Apple Events turned on.
  • In Safari, use tell application "Safari" and do JavaScript "…" in t, and turn on Develop → Allow JavaScript from Apple Events.

This version uses whose and is about 10x faster:

tell application "Google Chrome"
	repeat with w in windows
		repeat with t in (tabs of w whose URL contains "music.youtube.com")
			execute t javascript "document.querySelector('video').currentTime += 10"
			return
		end repeat
	end repeat
end tell

nice! didn't know this makes such a big difference :slight_smile:

maybe in another couple decades I'll finally master AppleScript :joy:

If you are willing to have this only work in the active window/tab, you can use the BTT action:
Send Shortcut to Specific App
where the App is whatever browser you use for Youtube, and the shortcuts are:
forwards 10 sec : L

backwards 10 sec : J

(I have this working on a dial on my streamdeck. It's quite effective for quickly moving around in a track.)

thank you all ! this is awesome