Rotate entire screen (Laptop too)

I’ve seen some applescripts floating round that rotate the screen of external monitors, but for an application I’m “trying” to write, I need to rotate the screen on an iBook or Powerbook. The only application that I’ve ever seen do this is Amit Singh’s SMSRotateD (http://www.osxbook.com/software/sms/smsrotated/)

Anyone know of an applescript command to do this? (Or any other command, terminal, OB-C, C, C++, anything!)

edit Corrected Names