A stylised depiction of Rob

Primary Unit

Update: Restart in Windows

Update 2013-05-25

Please ignore this post and look at my most recent post about the script.

I came a across a more sophisticated method of getting your Bootcamp partition’s device ID for my restart in Windows AppleScript, so you may want to grab the new code (also below).

It no longer uses my hack to pull the device ID from a certain character position in the result of a shell command — which would break if you had more than 10 disks or partitions anyway — and instead just uses grep and awk to strip out the identifier. It should be pretty solid.

applescript:
set deviceID to (do shell script "diskutil info [Your Bootcamp ¬
partition's name] | grep Identifier | awk '{print $3}'")
do shell script "bless -device /dev/" & deviceID & " -legacy -setBoot ¬
-nextonly" password "XXXXXXX" with administrator privileges
tell application "Finder" to restart