How to use applescript to enter the system print dialog?

I want to automatically print chrome windows (without dialogs) if they are suitable for a kind of URL pattern (for example, they don't have a given set of URLs).

Can you use apple script for this? Can anyone share an example? (I don't have a mac, so I can't experiment myself)

+6
source share
1 answer
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 
+6
source

Source: https://habr.com/ru/post/951647/


All Articles