{"id":32,"date":"2005-04-13T18:34:36","date_gmt":"2005-04-13T17:34:36","guid":{"rendered":"http:\/\/reinventedsoftware.com\/blog\/2005\/04\/13\/isnt-applescript-marvellous\/"},"modified":"2005-06-16T21:43:06","modified_gmt":"2005-06-16T20:43:06","slug":"isnt-applescript-marvellous","status":"publish","type":"post","link":"https:\/\/reinventedsoftware.com\/blog\/2005\/04\/13\/isnt-applescript-marvellous\/","title":{"rendered":"Isn&#8217;t AppleScript Marvellous!"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/reinventedsoftware.com\/blog\/images\/ScriptEditor.png\" alt=\"Script Editor application icon\" title=\"Script Editor Application\" align=\"right\" \/>I reckon that one of the most underrated features of the Mac is (still) <a href=\"http:\/\/www.apple.com\/applescript\/\">AppleScript<\/a>. If you don&#8217;t already know, using AppleScript you can record and automate tasks, extend existing functionality, tie applications together and &#8211; using <a href=\"http:\/\/www.apple.com\/applescript\/studio\/\">AppleScript Studio<\/a> &#8211; even create proper standalone applications.<\/p>\n<p>Here&#8217;s how it helped me lately and re-whet my appetite for adding AppleScript support to Feeder (I know, it should have been there in the first place, but it got postponed).<\/p>\n<p>With Feeder, a common support problem is the FTP publishing. Not once since I replaced the <a href=\"http:\/\/developer.apple.com\/documentation\/Networking\/Conceptual\/CFNetwork\/Chapter_1\/chapter_2_section_3.html\">CoreFoundation FTP stuff<\/a> with <a href=\"http:\/\/curlhandle.sourceforge.net\/\">cURL<\/a> has one of these problems been an actual bug; it usually comes down to <a href=\"http:\/\/reinventedsoftware.com\/support\/feederfaq.html#ftpmode\">whether or not FTP Passive Mode is in use<\/a> or something that I will politely term &#8220;user misunderstanding&#8221;. \ud83d\ude00<\/p>\n<p>A big part of support is to get information from log files (e.g. your Console log or a crash log) to work out what is going on. With the FTP stuff, you don&#8217;t want to be logging all the time and Feeder doesn&#8217;t have a transcript window like real FTP clients, so I added a hidden preference to enable and disable this logging as needed.<\/p>\n<p>You may already know that you can view and change an application&#8217;s preferences using the &#8220;defaults&#8221; command in the Unix shell. For example:<\/p>\n<div align=\"center\">\n<tt>defaults read com.apple.iPhoto<\/tt>\n<\/div>\n<p><img decoding=\"async\" src=\"https:\/\/reinventedsoftware.com\/blog\/images\/AppleScript.png\" alt=\"AppleScript icon\" title=\"AppleScript - So Cool!\" align=\"left\" \/>Using the command-line is a bit scary for many users, so I wrote a quick AppleScript to toggle Feeder&#8217;s &#8220;FTPDebug&#8221; hidden preference. You can download it <a href=\"http:\/\/reinventedsoftware.com\/feeder\/downloads\/FeederFTPDebug.zip\"> here<\/a>. <\/p>\n<p>The script was saved as an application, so to run it you just double-click its icon. If you&#8217;ve never seen AppleScript and would like to see the code, just drag it to the Script Editor&#8217;s icon in your \/Applications\/AppleScript folder. You will see that it is <i>almost<\/i> English. <\/p>\n<p>Yes, there&#8217;s stuff like VBScript and you can write Unix shell scripts, but I don&#8217;t think any other platform has anything as easy and powerful as AppleScript.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I reckon that one of the most underrated aspects of the Mac is still <a href=\"http:\/\/www.apple.com\/applescript\/\">AppleScript<\/a>.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,2],"tags":[],"class_list":["post-32","post","type-post","status-publish","format-standard","hentry","category-mac-software","category-software-development"],"_links":{"self":[{"href":"https:\/\/reinventedsoftware.com\/blog\/wp-json\/wp\/v2\/posts\/32","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/reinventedsoftware.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/reinventedsoftware.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/reinventedsoftware.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/reinventedsoftware.com\/blog\/wp-json\/wp\/v2\/comments?post=32"}],"version-history":[{"count":0,"href":"https:\/\/reinventedsoftware.com\/blog\/wp-json\/wp\/v2\/posts\/32\/revisions"}],"wp:attachment":[{"href":"https:\/\/reinventedsoftware.com\/blog\/wp-json\/wp\/v2\/media?parent=32"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/reinventedsoftware.com\/blog\/wp-json\/wp\/v2\/categories?post=32"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/reinventedsoftware.com\/blog\/wp-json\/wp\/v2\/tags?post=32"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}