{"id":1133,"date":"2016-06-01T23:26:13","date_gmt":"2016-06-02T06:26:13","guid":{"rendered":"http:\/\/markalldritt.com\/?p=1133"},"modified":"2016-06-02T15:33:03","modified_gmt":"2016-06-02T22:33:03","slug":"acorn-is-scriptable","status":"publish","type":"post","link":"https:\/\/markalldritt.com\/?p=1133","title":{"rendered":"Acorn Is Scriptable!"},"content":{"rendered":"<p>I oscillate between <a href=\"http:\/\/flyingmeat.com\/acorn\/\">Acorn<\/a> and <a href=\"http:\/\/www.pixelmator.com\/mac\/\">Pixelmator<\/a> on the Mac &#8211; its great to have two competent alternatives to Photoshop.  Pixelmator is my current fav on the iPad Pro (there&#8217;s nothing like using it&#8217;s object removal with the Apple Pencil).  However, today Acorn has me on the Mac because it is scriptable.  Whipped up this little script to generate images for Script Debugger 6 release notes:<\/p>\n\n<pre>\nuse AppleScript version \"2.4\" -- Yosemite (10.10) or later\nuse scripting additions\n\non downsampleImage(theFile)\n    local destFolderHFSPath\n    \n    tell application \"Finder\"\n        set destFolderHFSPath to get folder \"Web\" of desktop as string\n    end tell\n    \n    tell application \"Acorn\"\n        tell (open theFile)\n            local imageName, imageWidth, imageHeight\n            \n            set {imageName, imageHeight, imageWidth} to {name, height, width}\n            trim\n            \n            --  Create 1x down sampled image\n            web export width (imageWidth * 0.328) height (imageHeight * 0.328) as PNG in file (destFolderHFSPath & imageName & \".png\")\n            --  Create 2x down sampled image\n            web export width (imageWidth * 0.65) height (imageHeight * 0.65) as PNG in file (destFolderHFSPath & imageName & \"@2x.png\")\n            \n            close saving no\n        end tell\n    end tell\nend downsampleImage\n\non open theFiles\n    repeat with aFile in theFiles\n        downsampleImage(contents of aFile)\n    end repeat\nend open\n<\/pre>\n\n<p>No fuss, it just worked.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I oscillate between Acorn and Pixelmator on the Mac &#8211; its great to have two competent alternatives to Photoshop. Pixelmator is my current fav on&#8230;<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"https:\/\/markalldritt.com\/?p=1133\">Continue Reading<span class=\"screen-reader-text\">Acorn Is Scriptable!<\/span><\/a><\/div><\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[6,15],"tags":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p7AQk-ih","_links":{"self":[{"href":"https:\/\/markalldritt.com\/index.php?rest_route=\/wp\/v2\/posts\/1133"}],"collection":[{"href":"https:\/\/markalldritt.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/markalldritt.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/markalldritt.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/markalldritt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1133"}],"version-history":[{"count":6,"href":"https:\/\/markalldritt.com\/index.php?rest_route=\/wp\/v2\/posts\/1133\/revisions"}],"predecessor-version":[{"id":1151,"href":"https:\/\/markalldritt.com\/index.php?rest_route=\/wp\/v2\/posts\/1133\/revisions\/1151"}],"wp:attachment":[{"href":"https:\/\/markalldritt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1133"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/markalldritt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1133"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/markalldritt.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1133"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}