Archive for 2007

Mac app checklist in TaskPaper format

Wednesday, August 8th, 2007

TaskPaper is a to-do list app from Hog Bay Software. It’s currently free during its public beta. Its main stand-apart feature is its plain-text document format.

I’ve just created a TaskPaper version of my Mac app checklist, to make it easier for you to follow it for each application you make. You can download it in plain format or stationery format.

UPDATE 18:06 PDT: I just added the Info.plist key names for the check-your-Info.plist item, so if you’re missing those, you should redownload the file(s).

UPDATE 19:48 PDT: I also just added the sub-items of the ReadMe item. Again, if you downloaded it earlier, you should get a fresh copy.

UPDATE 21:54 PDT: Added advice to choose Prevent Editing from TextEdit’s Format menu.

Random function-key changes

Wednesday, August 8th, 2007

Previous assignment of function keys:

Key Function
F9 All windows
F10 This application’s windows
F11 Reveal Desktop
F12 Dashboard and Eject

This made (some) sense as the explanation for iLife 2008’s refusal to allow you to assign these keys to its functions.

New assignment of function keys on otherwise-yummy new keyboards (yes, both of them):

Key Function
F1 Decrease screen brightness
F2 Raise it
F3 Exposé (probably all windows), though it looks like it could just as easily summon a gallery app or iWeb or Stickies
F4 Dashboard, though Activity Monitor would be a reasonable definition for this key’s icon as well
F7 Previous track
F8 Playpause*
F9 Next track
F10 Toggle mute
F11 Decrease volume
F12 Raise volume
Eject

WTF?

* As named in iTunes’ AppleScript dictionary.

Four headers worth reading

Tuesday, August 7th, 2007
  • <Foundation/FoundationErrors.h>
  • <AppKit/AppKitErrors.h>
  • <CoreData/CoreDataErrors.h>
  • <WebKit/WebKitErrors.h>

These four headers define error codes in NSCocoaErrorDomain, which you can use in and expect from NSError instances.

There’s also <QuickTime/QuickTimeErrors.h>, but its error codes are OSStatuses (usable with NSOSStatusErrorDomain), which makes them better-known to begin with.

A complete raw list of KVC accessor selector formats

Tuesday, August 7th, 2007

Implementing and using (i.e., calling) these accessors will generate appropriate KVO notifications for free. (UPDATE 2008-11-10: If you’re targeting Leopard, declare and use (i.e., self.foo = bar) Obj-C 2 properties. Exception: Not in your init and dealloc methods, and that goes for regular accessors as well.)

Some are for arrays, some are for sets, some are only for mutable properties, and some are for all keys.

  • validate%s:error:
  • %sForKeyPath:
  • _%sForKeyPath:
  • get%s
  • is%s
  • _get%s
  • countOf%s
  • objectIn%sAtIndex:
  • %sAtIndexes:
  • get%s:range:
  • enumeratorOf%s
  • memberOf%s:
  • _is%s
  • set%s:
  • _set%s:
  • getPrimitive%s
  • primitive%s
  • setPrimitive%s:
  • add%sObject:
  • remove%s:
  • remove%sObject:
  • add%s:
  • intersect%s:
  • insertObject:in%sAtIndex:
  • insert%s:atIndexes:
  • removeObjectFrom%sAtIndex:
  • remove%sAtIndexes:
  • replaceObjectIn%sAtIndex:withObject:
  • replace%sAtIndexes:with%s:

Source: strings /S/L/F/Foundation.framework/Foundation.

Note that NSArrayController will not call the finer-grained array methods (e.g., insertObject:in%sAtIndex:) if you provide the basic get and set methods (%s and set%s:).

Gun-jumping Apple Bug Friday! 67

Thursday, August 2nd, 2007

This bug is iTunes viewport pinned to top of selection when selection is at top of viewport. It was filed on 2007-08-02 at 10:31 PDT.

(more…)

Blog spam count: 2007-07

Wednesday, August 1st, 2007

Spam comments blocked by Negative Turing Test in July 2007:

9,721

I wonder what caused the drop. (Not that I’m complaining!)

WWDC 2007 session videos are out

Monday, July 30th, 2007

If you attended WWDC, you can head over to ADC on iTunes and see what you missed.

270,000 iPhones sold in first two days—not

Wednesday, July 25th, 2007

UPDATE 17:05 PDT: My theories have been disproven by my sharp commenters. See the comments for the true explanation. Thanks, guys!

Quoth the DFLL:

Apple Reports Third Quarter Results 

270,000 iPhones sold in the first two days, and Jobs is quoted in the PR saying “we hope to sell our one-millionth iPhone by the end of its first full quarter of sales”.

Incorrect.

Here’s what Apple’s unaudited summary data (linked from that press release) says:

Q2 2007 Q3 2006 Q3 2007
Units K Rev $M Units K Rev $M Units K Rev $M
iPhone and Related Products and Services (6) 270 5

So they sold 270,000 of “iPhone and Related Products and Services”. Suppose that all of those are $499 (which we know is false):

499 × 270,000 = 134,730,000

$134M! That’s a long way from $5M.

The explanation is in that footnote 6:

(6) Consists of iPhones and Apple-branded and third-party iPhone accessories.

So if you bought an iPhone and a case, you effectively bought two iPhones for the purpose of that column. More accurately, you bought an iPhone (+1) and a Related Product (+1), for a total of +2.

I suspect the real number of iPhones, not counting accessories, is much, much closer to AT&T’s 146,000-activations number (since very few people will buy an iPhone and not activate it).

Reddit and Digg compared

Tuesday, July 24th, 2007

Parallel coverage of this hoax on the two sites.

The titles:

The comments (summarized):

  • Reddit: It’s fake. You can tell because the frame shown in the “screenshot” doesn’t appear anywhere in the actual YouTube question.
  • Digg: This was really really funny and the candidates deserved it, but it embarrassed the internet on national TV, and CNN will never do a debate like this again because of it. BTW, it’s fake.

The scores:

  • Reddit: +179-132=47 (and dropping)
  • Digg: 2510 (and climbing)

UPDATE 2007-07-25:: See Simone’s rebuttal in the comments.

An easy application to turn off applications’ Dock tiles

Tuesday, July 24th, 2007

I just released an application called Configure Application Dock Tile. The purpose of this app is to make it easy to turn an app’s Dock tile off or on.

I first had the idea when making some screencasts (including the Adium screencasts). Normally, iShowU shows up in the Dock, and I don’t like having that artifact in the screencast; I find it distracting. So I wrote this app to make it easy for me to turn off the Dock tile in future versions of iShowU.

(If you downloaded this earlier today, please do re-download it, as I overhauled the user interface. That’s why this post disappeared in the meantime.)

How to make your app’s Dock tile highlight

Monday, July 23rd, 2007

So, no matter what you do, your Dock tile doesn’t highlight when you drag a document onto it. You’ve hexadecuple-checked your CFBundleDocumentTypes list, and everything looks correct, but Dock is not co-operating and you just want to kick it.

Finally, you decide to remove the LSItemContentTypes key, and it works just fine! How can this be?


Well, since Tiger, LSItemContentTypes shuts out all the other document-type tag keys. Your CFBundleTypeOSTypes, your CFBundleTypeExtensions—all of those are ignored when LSItemContentTypes is present; it looks at nothing but the LSItemContentTypes list. Taking out LSItemContentTypes forces LS to look at your OSTypes and extensions lists instead.

More to the point, your problem is that the set of UTIs you’ve specified does not contain the UTI of the would-be document that you’re dragging.

You could be forgiven for expecting that having com.apple.application in your set of UTIs would allow you to open applications as your documents. This is not true, because a standardly-constructed Mac OS X application is of type com.apple.application-bundle. That type does conform to com.apple.application, but it is not equal to com.apple.application, so the Dock refuses your drag with a dismissive wave of its kerchief bundle and an AIFF file of a sharp “hmph!”.

So how do you find out the true UTI of your document?

The easy way is mdls. Ask for the kMDItemContentType property:

% mdls -name kMDItemContentType Foo.app
Foo.app -------------
kMDItemContentType = "com.apple.application-bundle"

But this only works on a volume with a Spotlight index; for example, it doesn’t work on disk images or RAM disks (same thing). Another way is Nicholas Riley’s launch, with its -f option:

% launch -f Foo.app
Foo.app: Mac OS X application package 
        type: 'APPL'    creator: …
        architecture: PowerPC, Intel 80x86
        bundle ID: …
        version: …
        kind: Application
        content type ID: com.apple.application-bundle
        contents: 1 item
        created: 2007-07-23 07:12:31
        modified: 2007-07-23 07:12:31
        accessed: 2007-07-23 07:12:41 [only updated by Mac OS X]
        backed up: 1903-12-31 17:00:00

Either way, put that UTI into your list. Then drags will work.

In summary, the Dock checks for equality of the prospective document’s UTI to the UTIs listed under LSItemContentTypes, not conformity. You need to list every UTI you support in your Info.plist, including those that conform to the ones you expect. It’s either that or give up on UTIs entirely.

(Summary suggested by wootest.)

UPDATE 08:44: ssp suggested mdls instead of launch.

Report-an-Apple-Bug Friday! 66

Friday, July 20th, 2007

This bug is File type of GIF files in UTI list is incorrect. It was filed on 2007-07-01 at 18:18 PDT.

(more…)

Free stuff on iTunes: TV edition

Wednesday, July 18th, 2007

Turns out that the iTunes Store has a complete list of all free TV episodes—more complete than the list of free stuff on iTunes that you can have on the main store page.

Still no free movies, though.

Adium GSoC podcast!

Tuesday, July 10th, 2007

This hasn’t gotten anywhere near the traction that I think it deserves, so I’m announcing it here too: We’ve done a podcast!

While we were supposed to be attending WWDC, Colin, David, and I played hooky and went down to the Googleplex to record an episode of the Google Summer of Code podcast. The podcast is hosted by Leslie Hawthorn, who runs the GSoC program. Adium participated last year and is participating again this year.

The episode, which is available from the GSoC blog post, is very funny and gives a bit of insight into how we run our open-source project.

It’s a little over 20 minutes of advice and programmer hilarity. Check it out. ☺

Apple Bug Friday! 65

Friday, July 6th, 2007

This bug is kIconServicesUpdateIfNeededFlag not documented. It was filed on 2007-05-25 at 02:02 PDT.

(more…)

Apple Bug Friday! 64

Friday, July 6th, 2007

This bug is kIconServicesNoBadgeFlag not documented. It was filed on 2007-05-25 at 02:00 PDT.

(more…)

I’ve been hotlinked!

Thursday, July 5th, 2007

So I was looking through my referers for June and noticed this row:

# Hits Referrer
4 671 1.17% http://www.phpbb2.pl/forum/i18n.php

Grepping the raw logs turned up lines like this one:

boredzo.org ☃☃.☃☃.☃☃☃.☃☃☃ - - [31/May/2007:06:01:11 +0000] "GET /plusminus/minus-8.png HTTP/1.1" 200 75 "http://www.phpbb2.pl/forum/i18n.php" "Mozilla/5.0 (Windows; U; Windows NT 5.0; pl; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3"

I’ve been hotlinked!

I always love it when people like and use my stuff, but in this case, it’s taking out of my bandwidth allowance. Not by much—those 671 hits add up to a whopping 50 K for the month (thanks, SuperPNG!)—but that’s not the point. This sort of thing is generally not kosher.

I wonder how goatse looks at 8×8 pixels…

Nah, I’m not that evil. Here’s what I’ve made to swap it out with:

An animated GIF that says “HOTLINKED!”

On the other hand, the img element on the hotlinking page doesn’t have a width and height, so I could always use a much bigger image. Perhaps 8.5×11″.

But I haven’t done either of those yet. I’ll give them a chance to save themselves first, by emailing them and asking them nicely to host the image themselves.

I’ll let you know what happens. ☺

UPDATE 21:47: I just sent them (I hope) this message via their contact form:

I noticed that you’re using the minus icon I created on your internationalization page:

http://www.phpbb2.pl/forum/i18n.php

That’s cool; I’m glad it’s finding use. However, I do ask that you host the image yourself, rather than linking to it on my site.

I say “I hope” because I can’t read Polish. Here’s the form’s response:

Wiadomosc została wysłana. Dziękujemy.
Kliknij TUTAJ aby przejsc do strony głównej

So, I hope that worked. I’ll check back in a week and see.

UPDATE 2007-07-24: OK, a bit late, but I just checked. They’re no longer hotlinking, which is good, but they’re also no longer using the minus icon at all. Ah, well.

Code signing: Not as new as you think

Tuesday, July 3rd, 2007

Code signing is new in Leopard, right?

Right?

No, actually; it’s much older, as I found out while responding to a question on programming.reddit. In my results for a Google search that I did, I stumbled over a link to TN1176, which mentions the addition of code signing.

TN1176 is the release notes for Mac OS 9.

The technote doesn’t actually say much. In fact, I can go ahead and quote it in full:

Apple Code Signing is a new technology in Mac OS 9
that allows applications, plug-ins, and content to be
signed by developers. Apple Code Signing Certificates
assure your customers of your identity and the integrity
of your products. For more information, please see the
Mac OS Security and Cryptography Web
site.

That site’s gone now, of course. Fortunately, the Wayback Machine saved a copy.

Screenshot of the icon for
Apple Verifier

Screenshot of the icon for
Apple Signer

The top link on that page is to the Security 2.0 SDK, which includes a lot of stuff relating to code signing. There’s a pair of utilities called Apple Signer and Apple Verifier, some API documentation, some sample code, some resource templates (remember those?), a library, and the debugging root certificate.

UPDATE 06:29: Apple Verifier actually comes with the OS, but Apple Signer is only available in the SDK.

If you’ve ever seen a 'sign' resource while hacking in ResEdit, now you know what it was.

Meet the new boss
Same as the old boss


Oh, and in case you’re wondering what the Signer and Verifier applications look like:

This screenshot shows Apple Signer generating a signature for the SDK archive.
Signer at work.

This screenshot shows Apple Signer verifying the same signature.
Signer can also verify.

This screenshot shows the result of Apple Signer's verification of the signature.
Result of verification.

This is a screenshot of the Apple Signer window that shows the contents of a certificate.Same window, but for a root certificate.
These are the certificates from the verification. The root cert is the “Issuer’s Certificate” for the other one.

This screenshot is of a dialog box that says “That application or control panel is not supported by Classic”.
This is why I didn’t explain the difference between Apple Signer’s Verify command and Apple Verifier: I don’t know, because this message comes up when I try to launch Apple Verifier. And no, I don’t know why the message comes up.

Blog spam count: 2007-06

Sunday, July 1st, 2007

Spam comments blocked by Negative Turing Test in June 2007:

38,502

MacUpdate alternatives

Saturday, June 30th, 2007

Following the recent flap about MacUpdate prematurely listing Perian 1.0 before it had really gone 1.0, I think it appropriate to present a list of software-listing sites that are not MacUpdate. If you want to boycott or just casually avoid MacUpdate, whether for that reason or other reasons, this list will help you do that.

You’ll know some of these, but you may not know all of them. I’ll start with the ones you probably know and build up to lesser-known sites. That said, the order is not strict, so just because site A came after site B doesn’t necessarily mean site A is any better or lesser-known.


  • VersionTracker: The old standard. This was the very first Mac-specific software-listing site, and MacUpdate’s primary competition (indeed, MacUpdate exists to compete with it).

    VT’s main downside is used to be that it is was a very ad-heavy page. This inspired MacUpdate’s founding principle: fewer (initially no, as I remember it) ads, so that the page would load faster.

    One handy—though well-hidden—feature is that on the “Updates by Category” tab, at the bottom, there’s a list of single-license lists, including a freeware-only list.

    UPDATE 2007-07-06: VT has mostly done away with ads, and has a freeware view. Thanks to Hoopla for pointing out my error and the freeware view in a comment.

  • Download.com: The other old standard. I’m not sure which is older. Unlike VersionTracker, Download.com was for Windows (maybe even DOS) first, then added Mac software later.

  • Softpedia: A more recent entry (at least on the Mac). It’s quite similar to Download.com and Tucows, IMO. You can tell that they were a Windows site first because of what every developer they list gets: an (unintentionally-)amusing email certifying that the developer’s software is virus-free, along with an icon on the listing page indicating the same certification. Mac users (at least those who haven’t used Windows recently) see this “100% virus-free” graphic and think “Yeah? Why wouldn’t it be?”.

    One nice feature is that, like VT, it lets you filter the list to only freeware.

    UPDATE 2007-07-06: The same update as above. Specifically, I added “, like VT,”.

  • Tucows: The third of three (that I know of) sites that originally only listed DOS/Windows software; also the other other old standard. I never used it much, but it’s much better than I remember it: the last time I tried it, I couldn’t figure out how to download any of the software listed.

  • iUseThis: The newest entry into this field. The hook of iUseThis is that it works similarly to digg: If you use an app, you can go to its listing and vote it up (that is, digg it) using the “i use this” button. AppFresh integrates it, which is nice if you’re both an iUseThis user and an AppFresh user. (Be sure to click the button on AppFresh’s iUseThis listing for mad cyclicality.)

  • Macintosh Products Guide: The elder of Apple’s two software-listing sites. Though it’s open to any software, the MPG emphasizes commercial products.

  • Apple’s Mac OS X Downloads: I suspect this isn’t well-known, because Apple’s main effort to publicize it is a menu item in the Apple menu. (It’s much better-known among Dashboard widget authors, as it was the first site indexing widgets.) Trying to help that, MacBreak did a recent MacBreak Minute about it. (To be clear, I had already known about it before the MacBreak episode.)

    Not to be confused with the Macintosh Products Guide, listed above.

    (Added a few minutes later: Chris tells me it actually does bring in a fair number of downloads, especially if you get featured.)

  • Pure-Mac: Unlike the others, Pure-Mac places less of an emphasis on the running list of new and updated titles, instead presenting above the fold its list of categories. This is Pure-Mac’s central feature: the other sites simply maintain a blob of software that you search with a field, whereas Pure-Mac breaks them down into smaller category blobs.

    Pure-Mac is also probably the fastest-loading of the sites, because it uses static pages rather than CGI.

    Full disclosure: I do know the maintainer somewhat, as both I and the maintainer have been regulars on the same IRC channel at the same time. That didn’t affect Pure-Mac’s placement within this list.

  • HyperJeff: Perhaps the smallest of the software-listing sites (though Pure-Mac gives it a run for its money). HyperJeff’s site lists libraries and frameworks alongside applications, and notes whether each app is Carbon, Cocoa, or Java. He has written about his catalog’s characteristics on his “Why this listing exists” page.

  • Open Source Mac: A simple, digested list of what the maintainers think are the best open-source apps on the Mac. If you’d like to use as little closed-source software as possible, this is a good first stop.

    Full disclosure: Adium is listed here, and I’m one of Adium’s developers. Again, that didn’t affect the placement of the site within this list.

  • Mac Games and More: Guess what it emphasizes!

    I found this one upon searching Google for “mac software” to check whether I’d missed any. I’ve never used it before, so I haven’t much to say about it.

You know, I never realized how many Mac-software listings there are before making a list. There are nearly a dozen listed here. That’s a cool fact right there.