Hmm, I’ve never tried AppleScript HTML DOM download images, but I’ve used Python for similar tasks. If you’re open to switching, `requests` and `BeautifulSoup` make this super easy.
That said, if you’re committed to AppleScript, try this:
```applescript
tell application "Safari"
set imgList to do JavaScript "Array.from(document.querySelectorAll('img')).map(img => img.src);" in document 1
end tell
```
Then, loop through `imgList` and use `do shell script` to download each image.
That said, if you’re committed to AppleScript, try this:
```applescript
tell application "Safari"
set imgList to do JavaScript "Array.from(document.querySelectorAll('img')).map(img => img.src);" in document 1
end tell
```
Then, loop through `imgList` and use `do shell script` to download each image.
