Jump to content

Creates screenshots of webpages – webkit2png

Recommended Posts


I'm trying to create workflow for creating screenshots

of webpages with webkit2png (in terminal). I installed

(homebrew and after webkit2png).


Please how can i create this workflow:


In alfred i write "print" and "space" and "url address"

and after that terminal run webkit2png "url address"


Please, please, please
Link to comment

That’s pretty easy to do.
You don't actually need to do install it via homebrew, the license allows you to download it, and use it directly in your workflow. So here are the steps.
1. Open https://raw.github.com/paulhammond/webkit2png/master/webkit2png and save it to your Desktop (File → Save Page As…). If it saves it as “webkit2png.txt”, our with some other extension, just rename it to “webkit2png”.
2. Go to Alfred’s Workflow tab, and create a new one, from a template (bottom left, the “+” → Templates → Essentials → Keyword to Script). You’ll see two small rectangles, connected by a line
3. Right‐click your workflow on the left pane (should be highlighted), and select “Show in Finder”.
4. Drag “webkit2png” from the Desktop to the Finder window that appeared. You can now close the window, and get back to your workflow in Alfred.
5. Double‐click the left square and fill‐in the “keyword” section, this is what you’ll type in Alfred to call the workflow (something like “w2p”). Save.
6. Double‐click the right square, and on the box that appeared, insert this text

python webkit2png -F "{query}"
mv *.png ${HOME}/Desktop/

7. Save.
8. You’re done.
Now just call Alfred, type “w2p” (or whatever you picked), paste your url, and you’re set. You should now go through the workflow and set the other text options to your liking.
Explanation of point 6.
The first line tells python (the interpreter webkit2png needs), to call webkit2png. -F means “only get the full‐screen version” (read the script for other options), and "{query}" means “whatever you typed into Alfred (in this case the URL).
The second line just moves the image(s) you just got to your Desktop.

Edited by Vítor
Link to comment
Thank you, thank you, thank you! Super!
Alfred 2 is best of best!
I added the piece of code:
Now I don't need write http://
python webkit2png http://"{query}"
mv *.png ${HOME}/Desktop/


next level is url with or without http:// :)

Link to comment

I apologise, there’s a mistake there, I use “pbcopy” so much that I always write it the few times I meant to type “pbpaste”.

python webkit2png "$(pbpaste)"
mv *.png ${HOME}/Desktop/

It should work now.

Edited by Vítor
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...