I have two partitions on my mac: Mac OS X and Windows 7. I constantly switch between them so I started looking for a way to restart automatically into the other partition (without having to press Alt on restart). For Windows it is easy because the Boot Camp utilities provided by Apple has a quick menu for that. On Mac, though, I had to search and I found this code in Apple Script:
do shell script "bless --mount /Volumes/Windows/ --setBoot" with administrator privileges
do shell script "shutdown -r now" with administrator privileges
The problem is this doesn't work. When it restarts after running this script it goes to the Mac partition, instead of Windows.
The good thing about AppleScript is that I can save it into an app and run if from the Dock, but so far it hasn't worked. Any ideas?