MACSCRPT Archives

September 2007

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Mark Lively <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Wed, 19 Sep 2007 12:58:27 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (25 lines)
On Sep 19, 2007, at 12:32 PM, Chuck Pelto wrote:

> How can I get the state of another Mac machine on the network? I.e.,  
> It's in SLEEP or it's OFF?
>
Sleep would be the same as on or off depending if the machine is setup  
to wake up for network events.  As for determining On or off, ping  
would probably be a good way to go.

on pingem(aHost)
	try
		do shell script "ping -o " & aHost
		return true
	on error
		return false
	end try
end pingem

{pingem("localhost"), pingem("Doesnotexist")}

{true, false}

-Mark
Who would be really concerned if he couldn't ping localhost

ATOM RSS1 RSS2