Vincent Gable’s Blog

July 3, 2008

NSApplicationName Inconsistencies

Filed under: Bug Bite,Cocoa,MacOSX,Objective-C,Programming,Sample Code | , , ,
― Vincent Gable on July 3, 2008

The value stored under the NSApplicationName key of the result of [[NSWorkspace sharedWorkspace] activeApplication] is not the always the name the user knows the application by. Worse, it’s not always the same as the name for the application that other APIs expect or return. Even fullPathForApplication: in NSWorkspace sometimes won’t recognize it!

The problem stems from the fact that there are at least five application names floating around, at least in concept: (1) the file name the Finder sees, which in the case of an application package is the package (bundle) name; (2) the name of the executable inside the package, (3) the long name used in many places for display purposes only; (4) the short name used as the application menu title and in a few other places where a long name won’t fit for display purposes; and (5) the process name of a running application. They aren’t always the same, especially in Microsoft and Adobe products.

–From an informative message by Bill Cheeseman.

So instead of relying on NSApplicationName I now use -[[NSFileManager defaultManager] displayNameAtPath:] then strip off the filename extension. This should give exactly the filename the user sees. Every time.


NSDictionary *appInfo = [[NSWorkspace sharedWorkspace] activeApplication];
NSString *appPath = [appInfo objectForKey:@"NSApplicationPath"];
NSString *name = [[[NSFileManager defaultManager] displayNameAtPath:appPath] stringByDeletingPathExtension];

And of course, you really should be using bundle identifiers, instead of names, to identify an application. Unfortunately, a very few applications are not bundles. (For example, Microsoft stuff prior to Office 2008), so it might be necessary to fall back on using a name to locate them in a path-independent way.

Creating a custom CFBundleName in an application’s info.plist file seems to confuse NSApplicationName. For this reason I don’t think setting it is a good idea.

UPDATE 2010-01-20: See also, Technical Q&A QA1544: Obtaining the localized application name in Cocoa

Learning From Other People’s Failures: Acrobat Reader 9

Filed under: MacOSX,Usability | , ,
― Vincent Gable on July 3, 2008

Epic Fail.

The PC version is awful too.

Unfriends

Filed under: Design,Quotes | ,
― Vincent Gable on July 3, 2008

Facebook‘s “People You May Know” feature shows you a few links to profiles of people you … well, may know. Put another way it’s a feature that
shows you people that all your friends know who you are not friends with. There aren’t pleasant names for these kinds of people.

Facebook is a spiteful conniving bitch

It continues to put my ex in the “people you may know” section.
You fuckin’ dirty backstabbing whore, facebook, I’ll kill you. Just keep rubbing that shit in, I’ll fucking kill you.

some bitter guy.

Applying the ‘The Security Mindset’ can keep you from implementing a similar feature.

June 28, 2008

Auto Dial

Filed under: Research,Usability | ,
― Vincent Gable on June 28, 2008

Today, most people I see making phone calls use cellphones. As near as I can tell, every time they call someone they know, they do it using their phone’s address book, instead of keying in their a ten-digit “telephone number”. It’s pretty obvious why. Nobody wants to have to memorize ten-digit numbers. And we think of people by their name, not some number.

This was not something that was hard to predict. Rolodexes have been in every office for decades, because people want to look up people by name, not number. Only recently has software supplanted them.

I was very surprised when I found this unknown invention from the late 1930’s

autodial.png
A NEW desk telephone directory not only finds the number you want but actually dials it for you. All you have to do is slide the knob on the face of the device, called an Auto Dial, to the name you want, then press the small lever at the foot of the machine. When the lever returns to its normal position, in five or six seconds, your call is made and you pick up the phone.

The Auto Dial was invented by a German before (World War II). The only sample in (America) is owned by Alfred Altman, President of the National Dairymen Association. The machine can handle any 50 telephone numbers desired by the user, and changes can be made at will.

The signals can be made up of any number of letters and digits, according to the system used in the local exchange. The regular hand dial on the telephone can be used in the ordinary way when the automatic device has been attached.

What an improvement over memorizing and/or dialing a number! We all have these devices built into our cellphones today. Frighteningly, the original appears easier to use then my cellphone’s “Address Book”.

So why didn’t this invention catch on half a century ago, not just a decade ago? I don’t know. I can only speculate, and I don’t think there is value in writing uninformed guesses down. But understanding why the Auto Dial was never popular is probably very instructive.

June 27, 2008

The Heat Barrier

Filed under: Research | , , , ,
― Vincent Gable on June 27, 2008

Technology improves at an overwhelming pace. The prospect of exponential growth has some people making fantastic predictions. Eg. “In 15 years, life expectancies will start rising faster than we age”.

I’m a big believer in the power of human invention. But I stumbled upon a somewhat sobering magazine article a few days ago.
CAN WE CRASH THE DEADLY FLAME BARRIER? (Oct, 1955)

Fly a plane fast enough and friction will melt it. Can we “put out the fire?”

As near as I can tell, the answer is no. Worse, maximum airspeed has declined over the years. For example, the absolute air-speed record of 2,194 MPH was set in 1976 with a currently retired aircraft. In 1976, we came up against the heat barrier, and could not break it. Since then, we have also retired the only two models of supersonic transport aircraft to see active service. The minimum time to cross the Atlantic is higher today then 20 years ago.

Now it’s safe to say that miles per gallon of fuel, and speed / gallon, have increased since 1976. This is almost certainly of more practical importance to the world. But I think it’s worth noting an example of a purely-technological dimension that has regressed with time. Not everything in technology doubles every two years.

June 24, 2008

open source just isn’t a very good strategy for fixing ugly

Filed under: Design,Quotes |
― Vincent Gable on June 24, 2008

And unfortunately, open source just isn’t a very good strategy for fixing ugly.

Hank Williams.

June 21, 2008

Nobody Likes a Pimp

Filed under: Quotes
― Vincent Gable on June 21, 2008

On a personal note, recently my shrink said to me, “Hey, Wil, why don’t you drop the pimp act? Nobody actually looks at show-offs and thinks, ‘Oooh, I like him.’ In fact, everyone resents them.”

This made a lot of sense, so I’m officially renouncing my phony pimpitude.

Wil Shipley

June 20, 2008

Modern Browsers

Filed under: MacOSX,Programming,Quotes | , , , ,
― Vincent Gable on June 20, 2008

… What struck me watching these (WebKit) demos is that you could build a really slick web app UI using stuff like the canvas tag, SVG, and advanced CSS. Yes, none of this stuff works in IE, and IE still has massive market share — but not among the sort of people who adopt hip new web apps. The combined market share for, say, Firefox 3 and Safari 3 is larger than the overall market share for Mac OS X. Plenty of developers write desktop software that only works on the Mac — why aren’t more people writing apps web apps that only work in truly modern web browsers? The first one to do it is going to be a sensation.

John Grubber

I didn’t have a sense for how far behind IE lags, historically and today, until I saw this compatibility table (via Toby Jungen),

Calculation of support of currently displayed feature lists

Internet Explorer Firefox Safari Chrome Opera
Far Past 6.0: 4% 2.0: 34% 3.1: 43% 0.2: 54% 9.0: 35%
Past 7.0: 12% 2.0: 34% 3.1: 43% 0.2: 54% 9.0: 35%
Present 8.0: 29% 3.0: 48% 3.2: 67% 1.0: 54% 9.6: 58%
Near Future (2009) 8.0: 29% 3.5: 78% 4.0: 88% 2.0: 84% 10.0: 63%
Future (2010 or later) 9.0: 29% 4.0: 86% 4.*: 88% 2.0: 84% 10.*: 72%

June 17, 2008

Every OS Sucks

Filed under: MacOSX,Programming,Usability |
― Vincent Gable on June 17, 2008

Funny, and true, video.

June 16, 2008

Backup

Filed under: Quotes,Security,Tips
― Vincent Gable on June 16, 2008

The single most important thing any company or individual can do to improve security is have a good backup strategy. It’s been true for decades, and it’s still true today.

Bruce Schneier

Here’s a good article on backing up data.

« Newer PostsOlder Posts »

Powered by WordPress