I got a question yesterday in the comments of my Why can’t Apple and China just be friends? post.
Reader Austin wanted to know how I created the “Incompatible Country” dialog box I used as the post graphic:

It’s actually pretty easy: I wrote a small AppleScript in Script Editor (/Applications/AppleScript/Script Editor) to create a custom dialog box with the text I wanted:
display dialog "The country \"China\" cannot be dominated by your products because its population and government are incompatible with your business model." with icon stop with title "Incompatible Country"
The “with stop” code indicates which icon I want to use in the dialog (you can also use “with note” and “with caution”). The “with title” part lets me (obviously) set the title of the box—in this case, “Incompatible Country.”
Using that script, you can create a mock dialog box that says pretty much anything.
And here’s a bonus: If you know how to use SSH to connect to another Mac, you can have fun with whoever’s on that computer by popping up custom dialogs remotely using a shell command like this:
$ sudo osascript -e 'tell app "Finder" to activate' -e 'tell app "Finder" to display dialog "Surfing porn again? Shame on you."'
Enjoy.
MacUser is your source for news, info, and opinion about Apple, the Mac, and the iPod. Our dedicated team of bloggers covers everything that is relevant to Mac users — and, okay, some stuff that’s not quite relevant, but is still a lot of fun.
Woo hoo! That's awesome, thanks so much. I just expected a reply in the form of another comment, not an actual post. Dan, you rock!
Hey, that's great to know. But how did you learn all this Dan?