{"id":220,"date":"2006-11-02T15:42:05","date_gmt":"2006-11-02T22:42:05","guid":{"rendered":"http:\/\/www.red-sweater.com\/blog\/220\/random-color-terminal"},"modified":"2006-11-02T17:36:12","modified_gmt":"2006-11-03T00:36:12","slug":"random-color-terminal","status":"publish","type":"post","link":"https:\/\/redsweater.com\/blog\/220\/random-color-terminal","title":{"rendered":"Random Color Terminal"},"content":{"rendered":"<p>Erik Barzeski stumbled on a <a href=\"http:\/\/nslog.com\/2006\/11\/02\/terminal_color_changing_via_applescript\/\">cool trick<\/a> with Terminal&#8217;s scriptability, allowing him to save presets for his favorite color schemes in AppleScript. His approach is especially brilliant since he&#8217;s using <a href=\"http:\/\/www.red-sweater.com\/fastscripts\/\">FastScripts<\/a> to trigger the scripts!<\/p>\n<p>\nThis gave me a little whimsy of an idea, that it would be cool to have a script on hand to change the color of the frontmost terminal to some random color scheme.\n<\/p>\n<p>\n<a href=\"http:\/\/www.red-sweater.com\/AppleScript\/RandomColorTerminal.zip\">Random Color Terminal<\/a> does just that. It sure comes up with some ugly schemes, but the good news is that with a Terminal-specific shortcut assigned to the script, I can rip through random choices until I see something I like. I even discovered a <a href=\"http:\/\/www.wilsonmar.com\/1colors.htm\">little algorithm<\/a> online to determine whether black or white text is best for the given background color.\n<\/p>\n<p>\n<img decoding=\"async\" src=\"http:\/\/www.red-sweater.com\/blog\/images\/ColorTerminals.gif\"\/>\n<\/p>\n<p>\nSpeaking of Terminal and AppleScript, here&#8217;s a little quickie that I really appreciate in Terminal:\n<\/p>\n<p><pre>\ntell application \"Terminal\"\n\ttry\n\t\tdo script \"cd ~\/\" in window 1\n\ton error\n\t\tdo script \"cd ~\/\"\n\tend try\nend tell\n<\/pre>\n<\/p>\n<p>\nIt shouldn&#8217;t be hard for you to recognize this as &#8220;go to my home directory.&#8221; So what&#8217;s the big deal? Well I set it as a FastScripts shortcut with the key combination &#8220;Cmd-Shift-H.&#8221; <em>The same combination<\/em> as the Finder uses for the same action. So now whether I&#8217;m sitting in Terminal or the Finder, that basic keystroke gets me to the same place.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Erik Barzeski stumbled on a cool trick with Terminal&#8217;s scriptability, allowing him to save presets for his favorite color schemes in AppleScript. His approach is especially brilliant since he&#8217;s using FastScripts to trigger the scripts! This gave me a little whimsy of an idea, that it would be cool to have a script on hand [&hellip;]<\/p>\n","protected":false},"author":10,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,6,19,12],"tags":[],"class_list":["post-220","post","type-post","status-publish","format-standard","hentry","category-applescript","category-fastscripts","category-technology","category-usability"],"_links":{"self":[{"href":"https:\/\/redsweater.com\/blog\/wp-json\/wp\/v2\/posts\/220","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/redsweater.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/redsweater.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/redsweater.com\/blog\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/redsweater.com\/blog\/wp-json\/wp\/v2\/comments?post=220"}],"version-history":[{"count":0,"href":"https:\/\/redsweater.com\/blog\/wp-json\/wp\/v2\/posts\/220\/revisions"}],"wp:attachment":[{"href":"https:\/\/redsweater.com\/blog\/wp-json\/wp\/v2\/media?parent=220"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/redsweater.com\/blog\/wp-json\/wp\/v2\/categories?post=220"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/redsweater.com\/blog\/wp-json\/wp\/v2\/tags?post=220"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}