我希望自动打印Chrome窗口(无对话框),如果它们符合某种URL模式(例如不属于给定的一组URL),您能否使用Apple脚本实现这一点?能否分享一个例子?(我没有苹果电脑,所以无法自己尝试)
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