Archive for the ‘Entertainment’ category

An AppleScript Quine

November 3, 2007

A few days ago, out of morbid curiosity, I went looking for a a quine written in AppleScript. To my surprise, I couldn’t find one.

I’d never actually written a quine before, so this was a good ‘excuse’ to make one (and brush up on some computability theory — use it or lose it).

Well, here it is. When run it will make Script Editor create a new window containing the source code.

This might seem like a strange way of printing. But AppleScript doesn’t have a printf function per-se. I thought about using display dialog to show the source, but the text wouldn’t be copyable, making bootstrapping difficult. Letting the source-string be the result of evaluating the script wasn’t a good solution ether, because Script Editor puts an extra “” around any result that’s a string. Using osascript to run the script could work, but I think it would be breaking the “spirit” of AppleScript to force the quine to be run from the command-line.

Unfortunately, I encountered what appear to be Leopard bugs in Script Editor. (Update 2008-10-11: this problem seems to be fixed.)
When bootstrapping/testing, the result window would sometimes be filled with…something inexplainable.For example

«handler ASCII character of item i of x»
quote pi 40 of string_from_ASCII_numbers(set_d_to)
100
quine
((5 blank lines))

I don’t know why, I don’t know how. But it’s a troubling inditement of AppleScript support in 10.5.0.
I could reproduce a problem like this:
* quit Script Editor
* open the quine in Script Editor, and run it.
* run the resulting window (“Untitled”)
* run the resulting window (“Untitled 2”)

* around “Untitled” 5 or 6, the result was “100”.
* keep iterating like this, and see what unpredictability awaits (the most iterations I could get before Script Editor crashed was 12).
In Tiger, the problem couldn’t be reproduced AFAIK.

I hope this regression is an isolated incident. It’s just one more reason I’m not fond of AppleScript.

Advertisements

Stay Focused

October 2, 2007

Here’s a clipping from an online ad for an album:
In Stores and Online Now

IN STORES AND ONLINE NOW

The ad was the album’s cover-art, with these words added. The album is on the Sony label, and the ad linked to a page selling the album in a Sony music store.

What’s interesting about this copy is that it focuses on how you buy the music, over actually selling the music to you. “Available now” gives the same message, using less then half as many words. Fewer words mean a less cluttered ad that is quicker to read. It means less CAPITAL letters uglifying an attractive image.

Actually, I don’t think it’s even necessary to say “available now”. I mean, if you see an ad for something, and there isn’t a “coming soon” disclaimer on it, it’s pretty well understood that you can buy it right now. The unadulterated CD cover ad would have been a more effective ad. CD covers are specifically designed to be attractive, and sell CDs. You couldn’t ask for more from an ad. Adding extraneous information dilutes the message.

There is no good reason to even mention the method of distribution. But the person placing the add is in the business of music distribution. To them the distinction between a CD and a download is important. But implementation details (in this case how the music is delivered) should not be exposed.

Focus is essential to good design, be it advertising, or interfaces.

Ratatouille Lifted

August 2, 2007

Yesterday I saw Ratatouille, it was very fun. They did an amazing job of showing the taste of strawberries as moving colored light. It was one of the few cases I can think of where motion made a graphic better in every way. Maybe it’s all those horrible animated banner adds I see online, but I have become very skeptical about the value of animating simple images.

But what stole the show for me was the Pixar short they opened with: Lifted. It’s hilarious, and a great example of why things need to be labeled, and why 10,000 options won’t work. If you can, you should see it. I am going to try and get a copy of it, in case I ever need to convince someone that they need to do more to differentiate controls, and not overwhelm the user with choices. you can see it here, but it’s low quality.