{"id":752,"date":"2012-02-08T23:31:27","date_gmt":"2012-02-08T22:31:27","guid":{"rendered":"http:\/\/www.nimbling.com\/blog\/?p=752"},"modified":"2012-02-11T14:32:14","modified_gmt":"2012-02-11T13:32:14","slug":"applescript-to-quickly-batch-resize-crop-or-pad-images","status":"publish","type":"post","link":"https:\/\/nimbling.com\/blog\/2012\/02\/applescript-to-quickly-batch-resize-crop-or-pad-images\/","title":{"rendered":"Applescript to quickly batch resize, crop or pad images."},"content":{"rendered":"<p>Ever since I left <a href=\"http:\/\/qsapp.com\/\">Quicksilver<\/a> for <a href=\"http:\/\/manytricks.com\/butler\/\">Butler<\/a>, and later <a href=\"http:\/\/www.alfredapp.com\/\">Alfred<\/a> &#8211; I was left with a batch image-resizing itch. To scratch it, I wrote <a href=\"http:\/\/www.nimbling.com\/Downloads\/RCP.zip\">this<\/a> applescript (and Alfred extension). The script will ask you what to do, and takes your selection in the frontmost finder window, and performs image manipulations on it (Using a command line utility called &#8220;sips&#8221;).<br \/>\n<a href=\"https:\/\/nimbling.com\/blog\/wp-content\/uploads\/Screen-Shot-2012-02-08-at-23.20.19.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/nimbling.com\/blog\/wp-content\/uploads\/Screen-Shot-2012-02-08-at-23.20.19.png\" alt=\"\" title=\"Screen Shot 2012-02-08 at 23.20.19\" width=\"474\" height=\"295\" class=\"aligncenter size-full wp-image-757\" srcset=\"https:\/\/nimbling.com\/blog\/wp-content\/uploads\/Screen-Shot-2012-02-08-at-23.20.19.png 474w, https:\/\/nimbling.com\/blog\/wp-content\/uploads\/Screen-Shot-2012-02-08-at-23.20.19-300x186.png 300w\" sizes=\"auto, (max-width: 474px) 100vw, 474px\" \/><\/a><br \/>\nSpecifically:<br \/>\n<strong>Rescale<\/strong><\/p>\n<ul>\nIf one dimension is given, it resamples image(s) so height and width aren&#8217;t greater than the specified size, keeping aspect ratio.<br \/>\nIf two dimensions are given, it resamples the image(s) to the given values, ignoring aspect ratio.\n<\/ul>\n<p><strong>Crop<\/strong><\/p>\n<ul>\nCrops the image(s) to the given dimensions. If only one value is entered, uses this for both sides.<\/ul>\n<p><strong>Pad<\/strong><\/p>\n<ul>\nPads the image(s) to the given dimensions. If only one value is entered, uses this for both sides.<\/ul>\n<p>To use this script with <a href=\"http:\/\/www.alfredapp.com\/\">Alfred<\/a>, you&#8217;ll need to get the <a href=\"http:\/\/www.alfredapp.com\/powerpack\">powerpack<\/a> too, which was totally worth it for me.<\/p>\n<p><strong>Grab the script <a href=\"http:\/\/www.nimbling.com\/Downloads\/RCP.zip\">here<\/a>!<\/strong><br \/>\nFYI: SIPS (and as such, this script) supports the following file formats: jpeg | tiff | png | gif | jp2 | pict | bmp | qtif | psd | sgi | tga &#8211; I tested it on a psd, and it worked, but be aware it flattens the file :) Also, no, the script does *not* check beforehand if you have the right kind of files selected.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ever since I left Quicksilver for Butler, and later Alfred &#8211; I was left with a batch image-resizing itch. To scratch it, I wrote this applescript (and Alfred extension). The script will ask you what to do, and takes your &hellip; <a href=\"https:\/\/nimbling.com\/blog\/2012\/02\/applescript-to-quickly-batch-resize-crop-or-pad-images\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":757,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[117,120,119,118],"class_list":["post-752","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ui-customization","tag-alfred","tag-applescript","tag-butler","tag-quicksilver"],"_links":{"self":[{"href":"https:\/\/nimbling.com\/blog\/wp-json\/wp\/v2\/posts\/752","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nimbling.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nimbling.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nimbling.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nimbling.com\/blog\/wp-json\/wp\/v2\/comments?post=752"}],"version-history":[{"count":15,"href":"https:\/\/nimbling.com\/blog\/wp-json\/wp\/v2\/posts\/752\/revisions"}],"predecessor-version":[{"id":822,"href":"https:\/\/nimbling.com\/blog\/wp-json\/wp\/v2\/posts\/752\/revisions\/822"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nimbling.com\/blog\/wp-json\/wp\/v2\/media\/757"}],"wp:attachment":[{"href":"https:\/\/nimbling.com\/blog\/wp-json\/wp\/v2\/media?parent=752"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nimbling.com\/blog\/wp-json\/wp\/v2\/categories?post=752"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nimbling.com\/blog\/wp-json\/wp\/v2\/tags?post=752"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}