One Quickie

Caveman debugging in both Safari and Dashboard (Dashboard->General)
It'd be too convenient to have a uniform mechanism to perform caveman debugging of widgets in both Safari-preview mode (where you can use window.console.log) and Dashboard mode (where you can't). Luckily (?), window.alert in Dashboard will log to the console in Dashboard, but shows an alert in safari.

So, combine the two for maximal pleasure:

function cavemanLog(message) {
  if (window.widget) {
    // Won't display an error box, but will show in the console log.

  } else {
    // Send output to the javascript console.

} // cavemanLog

borkware home | products | miniblog | rants | quickies | cocoaheads
Advanced Mac OS X Programming book