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: Axel Luttgens <email@hidden>
- Date: Sun, 20 Aug 2006 16:21:42 +0200
On 18/08/06 23:13, Megan Mamalis wrote:
[...] but the “is equal to” statement never comes out true.
set myIP to "192.168.1.1"
set allcomps to the Internet address of every computer of computer
list "All Computers"
repeat with thisIP in allcomps
if myIP is thisIP then
beep
end if
end repeat
Oddly enough, running “if myIP is in allcomps then...” comes out true
In "repeat with thisIP in allcomps", "thisIP" is set to references (item
1 of allcomps, item 2 of allcomps,... and so on).
On the other hand, the equality comparison operator takes the classes of
its operands into account.
In this case, "myIP" is a string, while "thisIP" is a reference; as a
result, they will always differ...
Try with this:
[...]
if myIP is contents of thisIP then
[...]
This should work (assuming the Internet address of a computer indeed is
a string).
HTH,
Axel
_______________________________________________
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