The Mac Observer

 
   
 
AppleScript
Posted: 04 February 2002 03:08 PM [ Ignore ]
stars_1
Total Posts:  2
Joined  2002-01-31

Hi folks,

i need some advice concerning AppleScript and MacOSX.
I just bought a Keyspan digital remote Control and i want to build a Script, that will let me shut down the computer via remote.
but how do i do this?
i tried to make a script: tell application “Finder” to shut down
but this doesent work, since AppleScript is still active, when the finder tries to shut down,
so the shut down process is always stoped because applescript ist still running.
how can i work around this.

2nd question do you have any idea how to start the script via
remote control?

Thanks a lot

Profile
 
 
Posted: 01 February 2002 02:18 AM [ Ignore ] [ # 1 ]
stars_1
Total Posts:  2
Joined  2002-01-31

Its me again, sorry but i forgot to mention that
i am running MacOS X (10.1)

Profile
 
 
Posted: 03 February 2002 02:32 PM [ Ignore ] [ # 2 ]
stars_1
Total Posts:  5
Joined  2001-11-23

Can’t script a shutdown in OS X.

Profile
 
 
Posted: 04 February 2002 03:08 PM [ Ignore ] [ # 3 ]
Administrator
Avatar
Total Posts:  882
Joined  2001-06-17

I was just about to agree with bobw, when I remembered you had to do something special with a shutdown script.

Here’s the script:

ignoring application responses
    tell application 
"Finder"
        
shut down
    end tell
end ignoring 

ignoring application responses will tell AppleScript not to wait for a result before going onto the next line of code.  Well, the script quits, and boom your shutdown is complete.  icon_smile.gif

 

Profile
 
 
   
 
 
‹‹ AppleScript Q & A      Hand-coding HTML ››

Apple Stock Quote (AAPL)

Loading...

Hot Topics

TMO Express

Join the TMO Express Daily Newsletter to get the latest Mac headlines in your e-mail every weekday. Find out more!

Top Deals From DealBrothers.com

Recent Features

Support The Mac Observer

We noticed you may be running AdBlock on your computer. It takes real money to run this site and to deliver the news, tips, and opinions you love to read.

If you wish to block the ads that pay for the creation of our content, we ask that you instead support TMO Directly, either with a $5 monthly recurring contribution, or a one-time donation of any amount of your choice. Thanks!

Subscribe with Paypal Donate with Paypal