6

如果它们适合某种 URL 模式(例如,不是给定的一组 URL),我想自动打印 chrome 窗口(没有对话框)。

你可以使用苹果脚本吗?有人可以分享一个例子吗?(我没有Mac,所以我不能真正自己试验)

4

1 回答 1

6
set i to 1
tell application "Google Chrome"
    activate
    tell window 1
        repeat with t in tabs
            --if title of t starts with "Example" then
            if {"http://example.com/", "http://aa.com/"} does not contain URL of t then
                set active tab index to i
                tell t to print
                delay 1
                tell application "System Events"
                    click button "Print" of window 1 of process "Chrome"
                    --keystroke return
                end tell
            end if
            set i to i + 1
        end repeat
    end tell
end tell
于 2013-08-14T13:16:11.383 回答