So *Now* Apple Will Let Me In…

After months of waiting, I received this email from Apple just a few minutes ago:

Thank you for applying to the iPhone Developer Program.

We have reviewed the information you submitted when you initiated your program enrollment request and we are ready to instruct you on the steps required to complete the enrollment process.

Please click here to review and agree to the Standard License Agreement. You must execute this agreement prior to completing the purchase and activation process for the iPhone Developer Program.

Once you complete and activate your purchase, your enrollment will be complete.

Thank you,

iPhone Developer Program

I guess now that the App Store is live, they can let more people into the program. Now I guess I’ll have to re-download the SDK and pony up.

MiddleClickClose for Safari 3.1.1

06/14/2009 Update: It now works with the just-released Safari 4, too.

Someone wrote to tell me that MiddleClickClose was no longer working after upgrading to Safari 3.1.1. I hadn’t yet installed the latest version, so this was news to me. I just upgraded, but MCC still worked for me. I’m not sure what the user’s problem was. Maybe he upgraded from Safari 3.0 to 3.1.1, skipping 3.1, which I can see how that would have broken it for him.

I did change the MaxBundleVersion in Info.plist to 5525.18, which is the current version of Safari, so if you’re having problems, install the copy linked below. Or edit the Info.plist file in MiddleClickClose.bundle/Contents yourself.

iTunes Should Remember Window Size

I subscribe to a lot of podcasts, and lately I’ve been subscribing to lots of video podcasts. I love watching GeekBrief in ginormous HD format. But not all of the videocasts come in that large format, so I have to right-click on them and select ‘Double Size.’ But the next time I watch GeekBrief, it spans both monitors, because iTunes applied my ‘Double Size’ selection to this video as well.

What would be nice is if iTunes remembered your video settings for each subscription instead of one setting for all. This would allow me to set ‘Actual Size’ for GeekBrief, but ‘Double Size’ for The Buzz Report. That would be really nice.

MiddleClickClose Updated

I announced here that I had updated MiddleClickClose to work with Safari 3.1, but that it had problems loading under Safari 3.0. Actually, the problem was that it wouldn’t load on a PPC chip; I was testing on my iBook G4, but I hadn’t generated a universal binary. That was caused by having the iPhone SDK installed. Anyway, I dropped back to Xcode 3.0 and got a universal binary built, and now everything is happy.

If you want the plugin, ensure you have SIMBL installed, download the binary package below, and unzip it in ~/Library/Application Support/SIMBL/Plugins and restart Safari.

As usual, it’s distributed under the GPL.

My, What a Large Amount of Virtual Memory You Are Using

I just checked my Activity Monitor to see how much of my 6 gigabytes of RAM was in use. I was shocked (shocked!) to discover that a Java RMI server program (that I wrote) appeared to be using a bit more virtual memory than it should. Take a look at this screenshot of this process:

I’m sure it’s just a reporting error, but it was still funny to see.

Safari 3.1 Breaks My Middle Click Close Extension

If you install the new Safari 3.1, my MiddleClickClose extension stops working. The first time you launch Safari, SIMBL complains that the plugin hasn’t been tested with this version of Safari, but that’s easily fixed by putting the proper version 5525.13 in Info.plist for the tag MaxBundleVersion. Once that’s done, the extension loads, but doesn’t seem to do anything. The problem is that the system is no longer delivering a mouseUp event when you middle-click a tab. I’m not sure what’s going on, but I will look into it. I’ve become dependent on my middle-clicks…

Middle Click Close For Safari

08/31/2009 Update: For Snow Leopard compatibility, see here.

08/13/2009 Update: It should now work with all future versions of Safari without having to update it again. Read about the change here.

06/09/2009 Update: I have just updated the plugin distribution to work with the just-released production version of Safari 4. If you have problems with it, please let me know.

03/05/2009 Update: It’s working again.

02/27/2009 Update: This plugin is not working with the just-released Safari Beta 4. I know this. I will have to spend some time with the beta before I know why it broke. I will try to find time to take a whack at it this weekend.

I love Safari on my shiny Mac Pro, particularly because it’s so much faster than Firefox. But one thing I missed from Firefox was being able to do a middle-click on a tab and have it close. After several failed attempts, I finally got some help from Mark Rowe who pointed me to a proper method-swizzling implementation. After switching my code to use that swizzler, everything fell into place. I’ve been happily using it ever since, I just never released it. I got an email the other day asking for it, so here it is.

Unlike my Export to Archive plugin for iPhoto, I didn’t build an installer for this one. It’s easy to install, but you still have to do it yourself. And there’s a dependency: SIMBL. Now, before Leopard shipped the word was that Input Managers would no longer be supported. After Leopard shipped we saw that wasn’t entirely true. So, once you get SIMBL installed and working, using my plugin is easy. This should work on both Tiger and Leopard. I’ve only tested it recently on Leopard, but I originally wrote it on a Tiger system.

  1. Get the binary package: MiddleClickClose.zip
  2. Create ~/Library/Application Support/SIMBL/Plugins if it doesn’t exist
  3. Unzip the MiddleClickClose.zip into this directory. You should end up with a directory called MiddleClickClose.bundle
  4. Restart Safari

If all goes well, you should now be able to use your middle mouse button to close Safari tabs. It works for me. If it doesn’t work for you, run the OSX Console and look for “MiddleClickClose loaded” in the “Console Messages” section.

If you want the source code, download it here.

I should mention that this really is a dirty hack, and may not work with future versions of Leopard. It works for me, but your mileage may vary. I hope it works for you, but it may not.

This code is distributed under the GPL v2.

QuickTime Player Annoys Me

The QuickTime player that Apple ships really, really annoys me. There are two reasons why I hate it: volume and geometry defaults. By this I mean that the player defaults to 100% volume, which is really loud, and top-left-of-window placement, with no way to set either of these in preferences. I don’t know who on the QT team at Apple thought these were good/valid defaults, but regardless of stupid defaults, I should be able to set preferences for these and have them respected. I would prefer the player to startup with a volume in the 25 – 50% range, and centered on my screen, or at least closer to the middle than the top-left. It’s absurd that these things can’t be changed by the user. I notice from Apple’s docs that if you want to embed a QT movie in a webpage you can set the volume…

I wrote an Automator script that changes the volume once the player starts, but there’s no way to set this workflow as a default. In other words, the only way I could use it was to drag a movie I wanted to watch onto the workflow’s icon, rather than just double-clicking on the movie file.

Is anyone else annoyed by this?

Monitor Log Using Console.app

When I’m working on a Linux desktop, I will frequently open a new shell window with tail -f on a log file I need to watch, such as my JBoss log. When I switched to my glorious Mac Pro I did the same thing, but it wasn’t exactly what I wanted.

I discovered that you can execute Console.app from the command line, so I have created a Bash alias that I run when I need to. Here’s what I put in my ~/.alias file:

alias jbtail='/Applications/Utilities/Console.app/Contents/MacOS/Console /opt/jboss/server/default/log/server.log &'

(Make certain all of that is on one line!) Obviously you should change the path to the log to be something you want to monitor. You can change the alias name to something else if you like. After editing the file, either logout or type . ./.alias (notice the dots) and that will load up the alias. Now you can type jbtail (or whatever you chose to call it) and Console.app will open for you watching changes to that log file.

What’s really nice about this method as opposed to just using Terminal.app is that Console.app remembers things like window geometry, fonts and, most importantly, which monitor it last ran on. This is really nice for people like me who have two monitors. I always want this log to show up on my second monitor, and once I’ve placed it there, future invocations of my alias will open it right where I left it.

If you already have a .bash_profile or .profile file in your home directory, look for a line that looks like this

test -r ~/.alias && . ~/.alias

If you see that, you’re all set. If not, adding it will ensure that your aliases get loaded when you next login. You could add the alias=... line directly to .profile or .bash_profile if you like, and skip the .alias file altogether. I have several aliases and I like to keep them in their own file.