Javascript 关键词自动点击器

Javascript 关键词自动点击器,javascript,google-chrome-extension,applescript,Javascript,Google Chrome Extension,Applescript,我想要一个JavaScript代码,允许我指定某个关键字,并让Twitter点击包含该关键字的链接。该脚本应该是为谷歌Chrome制作的,并且必须与互联网Twitter源TweetDeck配合使用。我试过了,但没有用 set myKeyword to "Jordan" tell application "Google Chrome" tell window 1 to tell active tab set URL to "https://web.tweetdeck.co

我想要一个JavaScript代码,允许我指定某个关键字,并让Twitter点击包含该关键字的链接。该脚本应该是为谷歌Chrome制作的,并且必须与互联网Twitter源TweetDeck配合使用。我试过了,但没有用

set myKeyword to "Jordan"

tell application "Google Chrome"
    tell window 1 to tell active tab
        set URL to "https://web.tweetdeck.com/"
        delay 3
        set num_links to (execute javascript "document.links.length") - 1
        repeat with i from 0 to num_links
            set myLink to execute javascript "document.links[" & i & "].href"
            if myLink contains myKeyword then
                execute javascript "document.links[" & i & "].click()"
            end if
        end repeat
    end tell
end tell

你确定你在使用javascript吗?这看起来不像我所认识的任何编程语言。@Michael0x2a它是和JavaScripts的混合体,这就是我的想法,因为我通常看到在开始编码时显示函数。您是否可以就如何修复提出建议?非常感谢!谢谢