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…

Apple Tells Me “Thanks, But No Thanks”

Like 10 million other iPhone fanboys, I applied for the Apple iPhone developer program. Today, one week after applying, I received this email

Thank you for expressing interest in the iPhone Developer Program. We have received your enrollment request. As this time, the iPhone Developer Program is available to a limited number of developers and we plan to expand during the beta period. We will contact you again regarding your enrollment status at the appropriate time.

Thank you for applying.

Best regards,

iPhone Developer Program

And I’ve seen lots of other people on Twitter complaining of getting the same email. One disappointed reject said this

As I understand it, no one got in except for a handful of large partner companies alla Google.

It’s bad enough that the “free SDK” isn’t actually free since you have to pay $99 to be able to load your apps on your own iPhone, but now they’re rejecting hopeful developers in bulk. They ought to let everyone in who wants in. What’s the harm?

Gee… I wonder if I’m violating some NDA by blogging this? I’m sure some of the helpful souls on the xcode-users list will let me know if I am.

iPhone SDK: No Joy For Me (So Far)

Like 10 bajillion other Mac fans yesterday, I downloaded the iPhone SDK. It took me four tries to get it, but I finally got it. I installed all 5.3 GB of it, and rebooted (reboot? what is this, Windows?) and then created a sample project, just like the ADC video shows. I excitedly clicked the ‘Build and Go’ button and… nothing. Well, not completely nothing, but not what was supposed to happen.

What was supposed to happen was that the app would build, the iPhone simulator would start up, the app would be loaded onto the simulator and then it would run. My app built, but the simulator didn’t run. All I saw was ‘Debugging of “Sample” ended normally’ in the Xcode status bar. I checked the Xcode console, and I get this every time I try to run the app:

[Session started at 2008-03-07 16:42:09 -0500.]
2008-03-07 16:42:10.772 Sample[1326:10b] Warning: CFFIXED_USER_HOME is not set!
2008-03-07 16:42:10.793 Sample[1326:10b] Warning: ASPEN_SIMULATOR_ROOT is not set!
Terminating since there is no system event server.
(Run the EventPump or pass the argument "-RegisterForSystemEvents" if you want to run without SpringBoard.

The Debugger has exited with status 0.

I’ve been exchanging emails with people inside Apple about this and the only suggestion so far was to run the uninstall script in /Developer/Library and reinstall. I have done both, but it still doesn’t work. Upon the suggestion of a friend, I created a new user account, logged in as that user and tried from there. Everything worked. Which means Xcode, the SDK and the simulator are all installed properly, but something in my account is dorking things up. I am loath to ditch my account and start over from scratch, but obviously something is wrong. Does anyone have any suggestions? I am awaiting another email from my guy at Apple, but if anyone else knows anything, please let me know. And when/if I get it working, I will document what worked here.

03/08/2008 21:47 Update: It’s working! w00t! It appears that if you are running Xcode in 64-bit mode, you get the errors that I got. If you run Xcode in 32-bit mode, it works. Now, I had switched to 64-bit mode when I installed Xcode 3.0, but when I installed 3.1, it got reset to 32-bit mode. Only it didn’t get reset, at least not for my user account. That’s why when I created another user account, it worked for him. I right-clicked on Xcode in my dock and selected ‘Show in Finder.’ Then I right-clicked on the Xcode icon and selected ‘Get Info.’ On the Get Info screen is a checkbox labeled ‘Open in 32 Bit Mode’ and it was checked. I unchecked it, launched Xcode and the same problem happened. Then I re-checked it, re-launched Xcode, and now the simulator works. If I uncheck it, the problem returns, proving the cause. Thus, you must run Xcode in 32-bit mode and even if you think you’re running in 32-bit mode, it wouldn’t hurt to toggle that checkbox a time or two just to make sure. (Thanks to Daniel Cliche who suggested the 64-bit problem.)

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.

Ordered: 13-port USB Hub!

I have a ton of USB devices and I’m am constantly running out of ports. I hate having to unplug one device to plug in another (much like Norm Abram has multiple routers so he doesn’t have to change the bits), but with only four ports on my Mac Pro and five on an external hub, that’s what I’ve been reduced to.

Until now. I just discovered Synchrotech’s 13 Port USB 2.0 Hub, which looks like exactly what I’ve been wanting. I just placed the order, and I should have it in about a week. This will give me a total of twenty-two ports, which should last me for a while. 🙂

Are My Local Krogers Blocking EDGE Data?

Since getting my iPhone, I’ve visited two Kroger stores near my house and in both stores I was unable to access the Internet over the EDGE network. In both stores I had 5 bars of signal, and in both stores I was able to place calls, so it wasn’t a signal problem. But in both stores, trying to access any website using Safari failed with a message about not being able to find the server. Now, in both stores the iPhone popped up its list of available WiFi networks and in both stores that list contained a single network called “nomad5.” In both cases the network was private, so I didn’t try to connect.

Am I seeing something nefarious where there is nothing? Is it just coincidence that in both of these Kroger stores I was unable to get on the EDGE network, despite the fact that I had a perfect signal? Is there some technical aspect that I don’t understand? I’d love an answer to this. There is a third Kroger that is about 5 minutes from my house, so I will try to get to it and run a test to see what happens there.

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?