Posted by Chris Blackburn
Sat, 03 May 2008 01:42:00 GMT
Thanks to Solomon White for his insights. I built the following rough script using this blog article. It fits my own Rails application workflow, so please modify it to your own taste.
I have this script setup to change colors for each type of tab, regular command line, script/console and script/server.
Enjoy…
require 'rubygems'
require 'appscript'
include Appscript
DEFAULT_PROJ = "~/Source/ruby/the_mom_trust"
project_dir = (ARGV.length > 0) ? ARGV[0] : DEFAULT_PROJ
project_dir = Dir.pwd if project_dir == "."
term = app('Terminal')
first_tab = term.do_script("")
current_window = term.windows.first
tab = current_window.tabs.last
term.do_script("cd #{project_dir} && clear && e", :in => tab)
app("System Events").application_processes["Terminal.app"].keystroke("t", :using => :command_down)
tab = current_window.tabs.last
term.do_script("cd #{project_dir} && clear && script/console", :in => tab)
tab.normal_text_color.set('white')
tab.background_color.set([0,11992,0])
tab.cursor_color.set('yellow')
app("System Events").application_processes["Terminal.app"].keystroke("t", :using => :command_down)
tab = current_window.tabs.last
term.do_script("cd #{project_dir} && clear && script/server", :in => tab)
tab.normal_text_color.set('white')
tab.background_color.set('blue')
tab.cursor_color.set('red')
Posted in Mac, Ruby | Tags applescript, mac, ruby, terminal | 2 comments | no trackbacks
Posted by Chris Blackburn
Wed, 20 Feb 2008 04:55:00 GMT
I love my MacBook like no other computer I’ve ever owned, and I’ve owned many. My initial thoughts on the MacBook Air were naturally positive. Beside the fact that I had just purchased my first MacBook, the one I currently own, three weeks before the new “Air” was announced…
MacBook Air shows: “never been a better time to switch to a Mac”: “‘As I look at a newly arrived MacBook Air laptop,’ writes Dean Takahashi (mercurynews.com), ‘it occurs to me there has never been a better time to switch to a Mac.’ And he points to the new MacBook Air as ‘a great example of the faster innovation’ that Apple offers customers. ‘The design is attractive and nobody can boast having a thinner notebook computer. It has an innovation dubbed Remote Disc. You install a disk on a desktop’s DVD drive. Then you can use your MacBook Air’s Remote Disc function to take over the DVD drive and install software into the MacBook Air. It’s an innovation that may signal the beginning of the end of disk media.’”
(Via Apple Hot News.)
... however, after closer investigation I was disappointed to find that the “Air” has no DVD drive, no removable or replaceable battery, no firewire port, etc.
Don’t get me wrong. I think it is a marvelous piece of engineering, as only Apple can achieve. But what if I’m on a plane and I want to watch a movie? How do I record my latest home videos to DVD? Then finally, one day the battery will run down and no longer take or hold a charge. Does Apple expect me to throw it away and buy a new one? Has anyone even asked them that question? Maybe we are all just hopeless fan-boys and girls and just drool over anything new Apple puts out.
No thanks. I’ll just happily keep my MacBook. I even like it better than the “Pro”.
Posted in Mac | Tags air, mac, macbook | 2 comments | no trackbacks