I have a machine that I've partitioned into several different areas. I've installed different versions of OS X on them, and boot between them to test things. I got tired of having to go to System Preferences, select the startup disc, clicking restart, etc., so I found a way to do it using the command line.
The actual command line method is...
bless -mount "/Volumes/name of the disc" -setBoot
...where name of the disc is the actual name of the hard drive, i.e. Macintosh HD.
do shell script ¬
"bless -mount \"/Volumes/Name of the drive\" -setBoot" ¬
with administrator privileges
do shell script "shutdown -r now" with administrator privileges
Another version (which I use) will let you choose which partition using buttons:
display dialog "Select a startup disk" buttons ¬
{"name of disc 1", "name of disc 2"}
set bootVol to the button returned of the result as text
do shell script "bless -mount \"/Volumes/" & bootVol & ¬
"\" -setBoot" with administrator privileges
do shell script "shutdown -r now" with administrator privileges
[robg adds: While the Option key can be held at startup to choose a boot drive, it takes some time as the machine scans and lists the bootable drives. By using a script to specify the startup disk, you won't have to wait during reboot.]
Mac OS X Hints
http://hints.macworld.com/article.php?story=20070126131322301