Category : applescript

to clickClassName(theClassName, elementnum) tell application "Google Chrome" set youtubeTab to (the first tab of window 2 whose URL contains "youtube") end tell tell application "Google Chrome" execute youtubeTab javascript "document.getElementsByClassName(‘" & theClassName & "’)[" & elementnum & "].click();" end tell end clickClassName clickClassName("ytp-play-button ytp-button", 0) I have two windows open on my MacBook. One on ..

Read more