小编Lun*_*na 的帖子

Apple 脚本在 Chrome 上打开网页并复制文本

好吧,这是我的问题,我尝试在 AppleScript 中编写代码,以便打开网页并复制所有文本,然后将其保存到变量中,并稍后使用该变量,问题是我已经为 safari 执行了此操作并且它运行良好,但对于 chrome 我不知道该怎么做,我今天开始学习这种语言,所以任何帮助将不胜感激。这就是我到目前为止所拥有的

    tell application "Google Chrome"
activate
set theurl to "http://www.webpage.com"
if (count every window) = 0 then
    make new window
end if

set found to false
set theTabIndex to -1
repeat with theWindow in every window
    set theTabIndex to 0
    repeat with theTab in every tab of theWindow
        set theTabIndex to theTabIndex + 1
        if theTab's URL = theurl then
            set found to true
            exit repeat
        end if
    end repeat

    if found then
        exit …
Run Code Online (Sandbox Code Playgroud)

applescript google-chrome

2
推荐指数
1
解决办法
5927
查看次数

标签 统计

applescript ×1

google-chrome ×1