This exercise is intended less as a hint, though there is one included, than as a demonstration of a potentially destructive OS X behavior that pre-OS X Mac veterans may find shocking.
This applies to Cocoa Save dialogs in general, but the behavior of TextEdit's dialog is particularly suited for demonstration purposes. Read this entire section before proceeding. First, create a folder on your Desktop, name it MyImportantStuff, and put some copies of files or folders inside (but seriously -- do not put anything important in there!). Next, launch TextEdit, choose Format > Make Plain Text (assuming yours is set to Rich Text as default), and type a few words into the document. Then choose File > Save. In the dialog, give it the name MyImportantStuff, choose the Desktop as the destination, and make sure the If no extension is provided, use .txt checkbox is not selected. Finally -- and this is important -- hit Return twice quickly, simulating too much caffeine or low batteries in your mouse.
Congratulations, your entire MyImportantStuff folder has now been replaced with a single plain text file! Why did this happen? It happened because of the combined effects of Cocoa apps being allowed to overwrite a folder with a file (perhaps related to the need to create package type files like .rtfd), and the fact that Replace is the default option in the confirmation dialog.
Note that this behaviour is shamefully inconsistent with that of the Carbon Save dialog, which has the safer default of Cancel, and does not seem to allow a folder to be overwritten by a file under any circumstances. The pre-OS X Save dialog (eg. in apps running in Classic) is the most user friendly of all -- if a folder is selected, the Save button changes to Open, simplifying navigation.
You can, however, use this behavior to write executable shell scripts entirely within TextEdit...
This is the token hint, with an application of a side-effect of Part I. Open a new plain text document in TextEdit, and enter the line of code below. If you are familiar with shell scripts, any suitable code will do:
Choose File > Save, click the New Folder button, and create a folder named HelloWorld.command. Press Command-Up-Arrow, give the document the name HelloWorld.command, and hit Return twice. Double-click the resulting HelloWorld.command file in Finder, and it should open Terminal.app, which will display the friendly message.
osascript -e 'tell application Terminal to display dialog Hello World'
Mac OS X Hints