Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Applescript to shutdown networked computer

Applescript to shutdown networked computer
Thread Tools
Fresh-Faced Recruit
Join Date: Dec 2000
Location: Trabuco Canyon, CA, USA
Status: Offline
Reply With Quote
Jul 1, 2001, 01:16 AM
 
Sorry if this has already been covered, but I couldn't find anything...
I am trying to figure out an Applescript that will enable me to shutdown a networked Mac.Both machines are running OS 9. I am on a TCP/IP network and have privledges for both machines. Any pointers for this rookie scripter would be appreciated.

Thanks in advance...
     
Mac Enthusiast
Join Date: Aug 1999
Location: Calgary, Alberta, Canada
Status: Offline
Reply With Quote
Jul 2, 2001, 12:13 AM
 
Try this.

<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier>set theOtherComputer to application <font color = red>"Finder"</font> of machine <font color = red>"eppc:<font color = brown>//<font color = blue>127.0</font>.<font color = blue>0.1</font>"</font></font>

using terms from application <font color = red>"Finder"</font>

tell theOtherComputer
shut down
end tell

end using terms from</font>[/code]

Replace "127.0.0.1" with the IP address or DNS name of the machine you want to target. You need to have Program Linking on on the target machine in order to control it.
     
morps  (op)
Fresh-Faced Recruit
Join Date: Dec 2000
Location: Trabuco Canyon, CA, USA
Status: Offline
Reply With Quote
Jul 2, 2001, 08:02 AM
 
Cool... I wasn't familiar with "eppc://..." however, I seem to still be coming up a bit short. And actually, perhaps because of the next naive question: How do you enable Program Linking of the Finder? (I', assuming it's the Finder I need to enable since this is a OS level script. right?

By the way, the machine that I am trying to shutdown is an ASIP 6.3.3 server. Not sure if that is relevant here.

Thanks again...
     
Mac Enthusiast
Join Date: Aug 1999
Location: Calgary, Alberta, Canada
Status: Offline
Reply With Quote
Jul 2, 2001, 04:00 PM
 
To enable program linking:

Go to the File Sharing control panel and click "Start" for Program Linking. You'll also need to click "Enable Program Linking clients to connect over TCP/IP" to enable linking over TCP/IP.



By default, there is a standard set of apps that have Program Linking enabled, including the Finder. To connect to other apps, you need to select the app you want to connect to, choose "File:Get Info:Sharing..." in the Finder, then check off the appropriate box.
     
morps  (op)
Fresh-Faced Recruit
Join Date: Dec 2000
Location: Trabuco Canyon, CA, USA
Status: Offline
Reply With Quote
Jul 2, 2001, 11:05 PM
 
Perfect. Thanks a bunch, you da man...

One last question (hopefully). I tried passing username/password parameters in the path (eppc://username assword@10.0.0.1) and got a -916 error. Any thoughts on how I can run the script you helped me out with without needing to login to the other machine? Otherwise, it works great

[ 07-03-2001: Message edited by: morps ]

[ 07-03-2001: Message edited by: morps ]
     
Mac Enthusiast
Join Date: Aug 1999
Location: Calgary, Alberta, Canada
Status: Offline
Reply With Quote
Jul 3, 2001, 01:08 PM
 
Apple's official word on that is to use the Keychain to store the username and password. Then, allow the AppleScript free access to it. That's the way I do it.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 11:07 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2