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