An alternative that might be considered is exporting a web page as a single-page PDF, which could then be converted to a PNG if desired. The PDF and a screenshot would not be identical but relatively close in most cases. Also, exporting a PDF doesn’t work on every web site, but it’s pretty reliable in my testing. This script needs refinement but works on my Sonoma computer.
set {hours:h, minutes:min, seconds:s} to (current date)
set theTime to text 2 thru -1 of ((1000000 + (h * 10000) + (min * 100) + s) as text)
set the clipboard to "Safari " & theTime
tell application "System Events"
tell process "Safari"
if (exists window 1) is false then error number -128
set frontmost to true
click menu item "Export as PDF…" of menu "File" of menu bar 1 -- localize if necessary
end tell
delay 1.0 -- test different values
keystroke "v" using command down
delay 0.5 -- test different values
keystroke return
end tell
kerflooey. Thanks for testing my script. I tried my script on MacScripters, and it worked fine. We’re both running Sonoma, so that’s not the answer. Perhaps another forum member will try my script.