Imagemagic mac9/25/2023 ![]() Note: You’ll need to have the “Get Selected Finder Items” step added at the beginning to make this work inside Automator itself. Now you can test it by selecting some images in the Finder and running the workflow (use the big “run” button in the Automator toolbar). Any help is welcome (via email or Twitter is best). The only thing I want to change is the name of the file I can’t figure out how to make the script grab the name of one of the input files and use that as the root of the resulting JPG. I have also hard-coded the path of the resulting file (the desktop) and the name of the file (shot.jpg). This version works with MacPorts installs. Depending on your install (whether you used Homebrew or MacPorts), this might be in a different place. It’s important to note that I have included the full path to the “convert” command here. You just need to paste this after the line that reads “do”: /opt/local/bin/convert +append ~/Desktop/shot.jpgĪlternatively you can just select-all in the edit box and paste in the whole thing: for f in +append ~/Desktop/shot.jpg ![]() You’ll see that Automator already added in a chunk of code to the edit box. The “+append” forces ImageMagick to put the images side by side (remove it to stack them vertically), and the “a.png b.png c.jpg” are - somewhat confusingly - two source files and an output file. ![]() The “convert” part is the command we’re using. The format for our ImageMagick command is this: $> convert +append a.png b.png c.jpg ![]() Then we need to paste in the actual command. Just make sure to remove it when you save the workflow, otherwise it’ll run twice and you’ll get some odd results.įirst, change the drop-down next to the “Pass input” option to “as arguments.” This will pass your files as files (I think, anyway - I’m no coder). If you want to test the workflow inside Automator, you should add it yourself. Note: If Automator wants to add a “Get Selected Finder Items” to the beginning of this workflow, then let it. The quickest way is to search for it in the left column and drag it to the big canvas on the right: Now we’ll add some steps to our workflow. If not, or if you’re already tinkering in Automator, just hit ⌘-N for a new file). Open up the app and choose “Service from this window (it should pop open on launch. Next up, we need to build our Automator workflow. Using MacPorts, type this: sudo port install ImageMagickĪnd to install ImageMagick using Homebrew type this: brew install ImageMagick Automator The instructions for both are at the above links. One caveat is that you’ll need Xcode and its command-line tools to be installed to use it, but Homebrew requires you paste one line of code into the Terminal to get it up and running. I used MacPorts, as there’s a dead-simple package installer for Mountain Lion, Lion and Snow Leopard. There are many ways to do this: You can build and install it yourself or you can use something like Homebrew or MacPorts to do it for you. Installing ImageMagick MacPorts And Homebrewįirst up you need to install ImageMagick. Bonus: Cult of Mac requires JPGs, so we’ll let the plugin output JPGs, whatever the input format (usually PNG for iOS screenshots). I figured I should be able to combine these to make a workflow that would let me select some pictures in the Finder, right-click them and have them concatenated into a single picture. I also use Automator all the time to create System Services, which are essentially Finder (or other app) plugins that do things to files, folders and text. I knew about ImageMagick, a command-line tool that can manipulate images in pretty much any way you can imagine. So I finally decided to do something about it. I then hit ⌥⌘-c to change the canvas size (tip: adding *3 after the existing pixel count in the dialog box will triple the width), hit ⌘-0 to right-size the view, and then manually drag the three screenshots to line them up. I usually open one picture in Acorn, then drag the others in on top (Acorn adds them as layers). ![]() The problem is that this is annoying busywork. We use landscape images in Cult of Mac posts, and iPhone screenshots are almost always portrait, so it makes sense to put three of them side by side. One of the most common things I do with pictures on my Mac is to take a few screenshots from an iPhone or iPad and combine them into one picture. Not convinced? Then let me tell you a story. Even crazier is that some of these tasks involve photos. It might seem crazy to say it, but even in 2013, the command line is still the best place to do a bunch of tasks with your computer. ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |