Bless drive and (soft) restart computer...?

Hello,

I have to switch between two boot drives many times throughout the day and I was trying to find a faster way/more automated way to go about doing so via AppleScript (rather than having to open preferences, select my startup disk and rebooting, or rebooting and sitting and waiting with the option key held down so I can select the right drive upon reboot).

Right now I’m using the following via AppleScript:

do shell script ¬
	¬
		"bless -mount \"/Volumes/Macintosh HD ME\" -setBoot --nextonly" with administrator privileges
do shell script "shutdown -r now" with administrator privileges

The problem is, the “shutdown” command just does a hard-shutdown (ie. if unsaved documents are open, etc. it doesn’t ask to save them or anything, it just seems like all processes are killed and the machine reboots). I’m wondering if anyone knows how I could modify the above code (or if there’s a better way to do this) where as the script would act more like going to the Apple menu and selecting Restart (thus opened, unsaved documents would alert before closing, application would shut down properly and THEN the machine would reboot).

If anyone could help, it would be most appreciated!

Thanks,
Kristin.

Hi,

try this line instead of the shutdown -r line

tell application "System Events" to restart

Works!
Thanks!
k.