Quick Look a URL via a script (Applescript, Automator, Shell…)?

There is also an Automator action for displaying a website in a Quick Look like window:

automator -i http://apple.com Desktop/Website\ Popup.workflow


Yes, it is possible, but not directly from the internet. The file needs to be downloaded first.

qlmanage -p '/path/to/file'

will show the quick look preview for that file. It will also write some debug information to stderr, so I usually append >/dev/null 2>&1 to the end of the command.

In your case, you will need to download the file first in order to get to the Quick Look preview. You also need the proper extension for qlmanage to recognize the file. cd ~/tmp; curl "$url" --O "quicklook.$extension" will download it into ~/tmp (this directory needs to exist) and you will need to set the extension beforehand with extension=${url##*.}.


The final shell script:
cd ~/tmp
url='http://images.apple.com/mac/home/images/hero_30years_then.jpg'
extension=${url##*.}
curl "$url" --O "quicklook.$extension"
qlmanage -p "quicklook.$extension"

And in an applescript:

set quicklookurl to "http://images.apple.com/mac/home/images/hero_30years_then.jpg"
do shell script "cd ~/tmp; url=" & quoted form of quicklookurl & "; extension=${url##*.}; curl \"$url\" --O \"quicklook.$extension\"; qlmanage -p \"quicklook.$extension\""