Code: Select all
do shell script "bless --device /dev/disk0s3 -legacy -setBoot -nextonly" with administrator privileges
tell application "System Events"
restart
end tell
To make sure this script works correctly for you, launch the terminal and type the command
df -k
Look for your Boot Camp volume (it's most likely called "/Volumes/Untitled"). At the beginning of that line there should something lke "/dev/disk0s3. If yours is different than that you'll need to tweak that part of the script above to make it function.