login about faq


Hello everyone,

I'm constantly swapping between my bootcamp and OSX partition and what I really like about the bootcamp program on windows, is that you can select "Restart on Mac OS X" in your taskbar, and I really miss that feature on OSX, I have to restart push alt and wait until it detects the Partitions and then rewait untill windows boots up, instead of that I'd like to be able to take myself a drink or whatever,

So I tried a very small program in the applescript editor, using the display dialog :

    set question to display dialog "Are you sure you want to reboot into Windows ?" buttons {"No", "Restart"} default button 2
set answer to button returned of question

if answer is equal to "No" then
    quit
end if

if answer is equal to "Restart" then
    do shell script "bless -mount /Volumes/BOOTCAMP -legacy -setBoot -nextonly" password "xxx" with administrator privileges
end if

(password is correct) the dialog appears, but the script isn't executed when I click on Restart, it just quits. however the "do shell script" works perfectly alone, I just don't want to accidentally click on it and lose all my opened windows, does somebody know what's wrong in this code ? (this is my first try with applescript, the only thing I've ever done is some small math programs with Delphi)

Greetings from Switzerland

asked Jun 05 '10 at 18:01

Floriferous's gravatar image

Floriferous
2511

Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported


Join Us in the Chat Room

Tags:

×1,970
×222
×56
×2

Asked: Jun 05 '10 at 18:01

Seen: 273 times

Last updated: Jun 05 '10 at 18:01