moom Posted April 15, 2013 Share Posted April 15, 2013 Hello, 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
vitor Posted April 16, 2013 Share Posted April 16, 2013 (edited) 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 line3. 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 April 16, 2013 by Vítor Link to comment
moom Posted April 16, 2013 Author Share Posted April 16, 2013 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
vitor Posted April 16, 2013 Share Posted April 16, 2013 Tip.If you change the first line to read python webkit2png "$(pbcopy)" then you don’t even need to type or paste the url in, just write “w2p”, and when you press return, it’ll get the URL from your clipboard. Link to comment
moom Posted April 16, 2013 Author Share Posted April 16, 2013 Good work, but something is wrong Now i have: python webkit2png "$(pbcopy)" mv *.png ${HOME}/Desktop/ Workflow: Link Link to comment
vitor Posted April 16, 2013 Share Posted April 16, 2013 (edited) 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 April 16, 2013 by Vítor Link to comment
moom Posted April 16, 2013 Author Share Posted April 16, 2013 Thank you, thank you, thank you I replace pbcopy to pbpaste and change "Argument required" to "No Argument" in keyword section Super! Link to comment
vitor Posted April 16, 2013 Share Posted April 16, 2013 Thank you, thank you, thank you I replace pbcopy to pbpaste and change "Argument required" to "No Argument" in keyword section Super! Yes, I had forgotten that part. Glad you could figure it out. After you finish setting it up (maybe add an icon to it), you can share it here, if you want to. Link to comment
moom Posted April 17, 2013 Author Share Posted April 17, 2013 Thanks a lot! I create this workflow I wrote your nick name Vítor to Created by... I made a new icon Do you agree? Link to comment
vitor Posted April 17, 2013 Share Posted April 17, 2013 Thank you. There’s no need for credit, though, I outlined the steps, but you’re the one who built it. Link to comment
moom Posted April 17, 2013 Author Share Posted April 17, 2013 Please, please, one question This code relocate all screenshots and icon.png from folder workflow to desktop. Please, how can I move png from folder without icon.png? Link to comment
vitor Posted April 17, 2013 Share Posted April 17, 2013 Change the second line to be ls *.png | grep -v icon.png | xargs -I {} mv {} ${HOME}/Desktop/ Link to comment
moom Posted April 17, 2013 Author Share Posted April 17, 2013 eleven minute... you are Superman! Thanks a lot! Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now