Re: Scripting "Startup Disk"
Re: Scripting "Startup Disk"
- Subject: Re: Scripting "Startup Disk"
- From: "Alatorre, Michael" <email@hidden>
- Date: Mon, 5 Aug 2002 10:07:04 -0700
>
I am trying to write a script that will change the startup system folder
>
to the Mac OS X system folder and then restart the computer.
Since I do this often enough, I use the following scripts (saved as
applications) to automate booting into the other OS:
-- restart script code from OS 9 into OS X
-- be sure to modify the hard disk name to your own
beep
display dialog "Do you really want to restart in OS X?" buttons {"Cancel",
"OK"} default button 2 ,
with icon 2
if button returned of result is "OK" then
say "Restarting in OS 10"
tell application "Startup Disk"
activate
set startup system folder alias to alias "OS
X:System:Library:CoreServices:BootX"
end tell
tell application "Finder" to restart
end if
Since OS 9 will allow me to assign this applet to a function key, I assigned
it to F15 on my desktop machine (F11 on my laptop) and launch it simply by
pressing that key.
-- restart script code from OS X into OS 9
property mypassword : "" -- embed password as property
if mypassword = "" then
set mypassword to text returned of ,
(display dialog ,
"Input your password to embed the property in this
application--you'll only be asked once so type carefully.
(beware: your keyed response will display! Be cautious of wondering eyes.)"
default answer "")
end if
beep
display dialog "Do you really want to restart in OS 9?" buttons {"Cancel",
"OK"} default button 2 ,
with icon 2
if button returned of result is "OK" then
do shell script ,
"/usr/sbin/bless -folder9
'/Volumes/NameOfYourOS9HardDrive/System Folder' -setOF" password mypassword
with administrator privileges
say "Restarting in OS 9"
end if
ignoring application responses
tell application "Finder" to restart
end ignoring
Currently, OS X doesn't allow me to assign this applet to a function key (at
least that I know of), so I place it in the Dock for quick access. Remember,
since you're embedding your password into the applet, only work with a copy
of that file in case you screw up the password or wish to share it with
others. HTH
Michael Alatorre (
mailto:email@hidden)
EIS Liaison Analyst
Cedars-Sinai Health System (
http://www.cedars-sinai.edu/)
Medical Affairs: 310.423.6237 310.423.0448 (fax)
"We learn from history that we do not learn from history." -- George Hegel
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.