Wednesday, November 21, 2007

Tile OS X Terminal window to Finder with AppleScript

I updated my AppleScript that will tile the terminal window nicely below the frontmost finder window.

For some reason setting the Terminal window bounds is very buggy. I resorted to using the deprecated methods {position and size} and have to loop it three times to ensure that it positions correctly.

I tied this to command-; in my app launcher, QuickSilver



tell application "Finder"
--make new Finder window
activate
if not (exists window index 1) then
make new Finder window
end if
set {x1, y1, x2, y2} to bounds of window index 1
end tell

tell application "Terminal"
activate

if (count of windows) is 0 then
tell application "Terminal" to activate
tell application "System Events" to tell process "Terminal" to keystroke "t" using command down
end if

-- For some reason it can take up to 3 times for Terminal to be properly adjusted
set L to {1, 2, 3}
repeat with xxx in L
set {xx1, yy1, xx2, yy2} to bounds of window index 1
set position of window index 1 to {x1, y1 + {yy2 - yy1}}
set size of window index 1 to {x2 - x1, y2 - y1}
end repeat

end tell

Saturday, November 3, 2007

OS X Leopard - Improved Terminal (almost perfect)

Sorry iTerm, my long friend. I may be giving you up now that Leopard's terminal has tabs and an over-all improved UI. Terminal starts up fast and is pretty dang stable. One gripe - "Why can't I name the tabs!" Ugh, this seems so obvious a feature. Yeah, you can use AppleScript to set the name of the overall window but that isn't all that helpful when you have multiple tabs open. Come on, this has got to be a two-day feature (one to implement, one to test).

Weird thing is that somewhere in Apple-land there is a small team that is responsible for maintaining Terminal. And they are programmers so you'd think that they'd make the shell as nice as possible and think of these features on their own.

Anyway, bravo for the improvements that did make it in but a small "boo" for my couple of wasted hours trying to figure out how to ActionScript custom tab names. Oh Apple, when you fall short, it really hurts.

OS X Leopard - Incompatibilities

I'm an early-upgrader to Leopard. After a week I'm digging it quite a bit. This is my small list of bitches in a otherwise pretty nice OS. I think a lot of the inconsistencies with the Java-based programs has to do with Apple's new GUI rendering. I don't know much more about it but I'm guessing that it broke (well damaged) a lot of SWT and Swing widgets. Mostly I'm posting these in case somebody else is running into the same issues:

  • Intellij - Works but now the UI is unstable. Switching tabs don't always work and a few other creeks and groans. I use this every day so it is a bit painful.

  • Popcorn 3 - Bought this last week for my iPhone so I could scale down movies and move them over. This won't even start up. Funny thing is Popcorn 1 still works fine. Roxio has a message on their site that a fix is forthcoming.

  • TextMate - Breaking Input Managers was an issue from day one. There is a work-around for the "edit in textmate" bug that works well but it is slightly kludgy.


I don't entirely blame Apple, seems to me if you are a maker of Apple software you'd do some work with the pre-releases to ensure your software still works with the upgrade.

Java 6 on OS X

Hey Apple, please be more vocal with your plans for Java. I love my mac and want to continue using it as my main development machine. I don't doubt good things are happening - just would like more (good) buzz out there. I've seen many Java developers be converted to mac (me included - now I own three macs and an iPhone) and then go on to spread the good word.

13949712720901ForOSX