How to Quick Switch Dual-Boot Mavericks and Yosemite Beta
iDownloadblog

Mac OS X users who have already installed the public beta version of Yosemite can now quick switch between Mavericks and Yosemite beta using a simple shell script command via AppleScript, which was created by iDownloadblog (iDB) reader Antony Verros.

The script enables users to quickly restart a computer and automatically boot into the desired desktop operating system (OS), without having to hold down the Option key at boot to select the bootable partition.

This utility could be very handy for dynamically switching between two OSs, while you don't have to wait for the computer to load up the boot process before you can choose the desired OS.

Here are a few simple steps to run the shell script command and enable the dual-boot OS on your system:

Step 1: Create a new document by launching Script Editor via Applications > Utilities > Script Editor.app on your Mac.

Step 2: Type the following shell script code into a blank AppleScript document:

set deviceID to (do shell script "diskutil list | awk '/Yosemite/ {print $NF}'")

do shell script "bless -device /dev/" & deviceID & ¬

" -setBoot -nextonly" with administrator privileges

tell application "Finder" to restart

Go to the first line of shell script and change "Yosemite" to the name of the partition which contains the OS you want to automatically boot into. For instance, if the preferred OS is installed on primary partition - "Macintosh HD", just boot into it by making the following changes to the script: set deviceID to (do shell script "diskutil list | awk '/Macintosh HD/ {print

Step 3: Save the script as an app with a suitable name such as "Switch to Yosemite". Then copy the file to a preferred location such as on your desktop or in a stack on your dock.

Tip #1: The app requires you to enter an administrator password every time you want to run it. However, you could bypass this prompt by manually adding the word "password" and your admin password in the third line of the code.

Note: Your computer might accidentally reboot if you unknowingly opened the app when the scripted password is active in the app.

Step 4: Set the password for the OS switching app by adding the following code into the script via BootCamp:

do shell script "bless -device /dev/" & deviceID & ¬

" -setBoot -nextonly" password MyPassword123 with administrator privileges

Tip #2: Just add "-legacy" just before "-setBoot" if you are booting into Windows on BootCamp. Also make sure that you change the directory name from "BOOTCAMP" if your partition uses a different name.

Step 5: Enter the following code into the script via Bootcamp:

set deviceID to (do shell script "diskutil list | awk '/BOOTCAMP/ {print $NF}'")

do shell script "bless -device /dev/" & deviceID & ¬

" -legacy -setBoot -nextonly" with administrator privileges

tell application "Finder" to restart

In this way, scripts can be configured for various OSs on your computer by placing them correctly in each system partition to avail the benefits of this app, while using Automator to enable triggers for running the script within any OS.

[Source: iDownloadBlog]