How to boot to bootcamp from OSX via Alfred
This is a quick overview of how to use Alfred to reboot to your machine to your bootcamp partition. Credit for the apple script goes to robjwells. I just added the authentication so you do not have to type your password in. A quick note on that, this is not very secure because your password is written in plain text. Use at your own risk. If you don’t mind being prompted for your password on restart replace the script below with the one from Robs’s website.
How to install
- In Alfred’s preference page create a new apple script extension.
- Call it Restart in Windows (or whatever you choose).
- Create a Keyword of Restart.
- Select Run in background.
- Copy the following Apple Script into correct box.
- Change BOOT_CAMP_PARTITION_NAME, USERNAME and PASSWORD to your values. Note they are all case sensitive.
set deviceID to (do shell script "diskutil info BOOT_CAMP_PARTITION_NAME | grep Identifier | awk '{print $3}'")
do shell script "bless -device /dev/" & deviceID & " -legacy -setBoot -nextonly" user name "USERNAME" password "PASSWORD" with administrator privileges
tell application "Finder" to restart



