Fetch youtube current video running in brave browser info through apple script

  Kiến thức lập trình

Below applescript is to fetch currently running youtube video detial info. But im getting error.

Syntax Error : Expected “,” but found identifier.

tell application "Brave Browser"
    if (count of windows) = 0 then
        return "No windows open in Brave Browser"
    end if
    set videoTitle to ""
    repeat with w in (every window)
        repeat with t in (every tab of w)
            if URL of t contains "youtube.com/watch" then
                set videoTitle to (do JavaScript "document.title" in t)
                exit repeat
            end if
        end repeat
        if videoTitle is not "" then exit repeat
    end repeat
end tell
return videoTitle

Help me to fix or give a solution

New contributor

Gokul Kannan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website

LEAVE A COMMENT