MACSCRPT Archives

September 2007

MACSCRPT@LISTSERV.DARTMOUTH.EDU

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

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

Print Reply
Mime-Version:
1.0 (Apple Message framework v901)
Content-Type:
text/plain; charset=US-ASCII; format=flowed; delsp=yes
Date:
Wed, 19 Sep 2007 12:58:27 -0400
Reply-To:
Macintosh Scripting Systems <[log in to unmask]>
Subject:
From:
Mark Lively <[log in to unmask]>
In-Reply-To:
Content-Transfer-Encoding:
7bit
Sender:
Macintosh Scripting Systems <[log in to unmask]>
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