Re: Script to reboot from X into 9
Re: Script to reboot from X into 9
- Subject: Re: Script to reboot from X into 9
- From: "John C. Welch" <email@hidden>
- Date: Sun, 10 Mar 2002 11:19:43 -0500
On 03/08/2002 15:43, "Mr Tea" <email@hidden> wrote:
>
But then I hit a brick wall trying to trigger a restart from the script.
>
It's there in the Finder's 'Legacy Suite', but when I try to make it happen,
>
the script (or the app that's trying to run it) just hangs. The restart
>
continues if I can find a way to pull the plug on the script.
>
>
So, is there a problem with restarting using AppleScript in OS X 10.1.3?
Nope...but if you just tell the Finder to restart, the script will of
course, wait for the finder to get done...hence your problem. You need to
wrap the Finder Tell in an 'ignoring application resonse' statement, and
then it works jes' peachy...as in my single volume example here, that I use
for playing Baldur's Gate II's "The Darkest Day" mod. For multiple
partitions, you may have to set the path to the 9 system folder differently.
set bootIntoNine to "/usr/sbin/bless -verbose -folder9 \"/System Folder\""
as string
--this sets up the path to bless, and the parameters for the command
set dialogReturn to display dialog "please enter the administrator password
for this machine" default answer ""
--allows the user to enter the admin password...this is visible in the
dialog, and is a limitation of the command
set thePassword to text returned of dialogReturn
--since display dialog returns a record, we have to get the text from that
for the password
do shell script bootIntoNine password thePassword with administrator
privileges
--sudo our bless command (other wise it won't work)
ignoring application responses
--without this, the script will wait for the Finder to tell it that it
restarted okay
tell application "Finder"
restart --restart the Mac
end tell
end ignoring
john
--
We're surrounded. That simplifies the problem.
- Chesty Puller, USMC
_______________________________________________
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.