Re: Scripting Adding computers to a list in ARD
Re: Scripting Adding computers to a list in ARD
- Subject: Re: Scripting Adding computers to a list in ARD
- From: "J. Stewart" <email@hidden>
- Date: Wed, 23 Aug 2006 04:58:37 -0400
On 8/22/06 at -0400 Megan Mamalis said this
>Does someone have a handler to take a list of IP addresses and spit back a
>list of computer names? I’m not sure how to express the idea that I’m
>looking for the name property of the computer whose internet address
>property is xxx.xxx.xxx.xxx. Well, that could be expanded to any given
>property of any item whose other any given property is x.
>--
--> Cut <--
tell application "Remote Desktop"
set cList to every computer in computer list "test"
set eList to {}
repeat with aComp in cList
set end of eList to {Internet address of (contents of aComp), name of (contents of aComp)}
end repeat
end tell
--> Cut <--
This returns a paired name, address listing of the computers on the list.
Given this, it's fairly simple to extract the names from the results of your existing script which already returns the address.
A simple loop like this one should be all you need -
--> Cut <--
repeat with j from 1 to count of eList
if first item of item j of eList contains "192.168.1.2" then return second item of item j of eList
end repeat
--> Cut <--
JBS
--
Whatever happened to Preparations A through G? - George Carlin
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden