Skip to content

Instantly share code, notes, and snippets.

Last active September 9, 2023 10:19
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
make a montage of screenshots from Safari tabs in top window. appleScript needs imageMagick & shot-scraper
--needs imageMagick & shot-scraper paths below refere to homebrew installs of both (guessing from the path)
set mytempFolder to do shell script "mktemp -d "
--just to watch things happening
do shell script "open " & mytempFolder
tell application "Safari"
set themax to number of tabs of window 1
set thelist to ""
repeat with x from 1 to themax
do shell script "cd " & mytempFolder & ";/opt/homebrew/bin/shot-scraper --quality 80 --wait 2000 " & URL of tab x of window 1 & " --width 1200 --height 800"
end try
end repeat
do shell script "cd " & mytempFolder & ";/opt/homebrew/bin/montage -mode concatenate *.jpg out.jpg || exit 0 "
end tell
set resultFile to POSIX path of (choose file name with prompt "Save As File" default name "links-montage.jpg" default location path to desktop) as text
do shell script "mv " & mytempFolder & "/out.jpg " & quoted form of resultFile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment