 |
 |
Applescript to shutdown networked computer
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Dec 2000
Location: Trabuco Canyon, CA, USA
Status:
Offline
|
|
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
|
|
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.
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Dec 2000
Location: Trabuco Canyon, CA, USA
Status:
Offline
|
|
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
|
|
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.
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Dec 2000
Location: Trabuco Canyon, CA, USA
Status:
Offline
|
|
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
|
|
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.
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|