Re: More Mac Ghost
Re: More Mac Ghost
- Subject: Re: More Mac Ghost
- From: g3pb <email@hidden>
- Date: Tue, 21 Nov 2000 19:14:11 -0900
set fRef to open for access file "imac:desktop folder:y"
set eaddr to "00:50:E4:1E:1C:6F"
set machineName to ""
set oldDelim to AppleScript's text item delimiters
set AppleScript's text item delimiters to tab
try
repeat until false
set dLine to read fRef before return
if text item 2 of dLine is eaddr then
set machineName to text item 1 of dLine
exit repeat
end if
end repeat
on error errMsg number errNum
set AppleScript's text item delimiters to oldDelim
end try
if machineName is "" then
display dialog "not found"
else
display dialog machineName
end if
set AppleScript's text item delimiters to oldDelim
-- hcir
mailto:email@hidden
>
I have a file that goes like this:
>
>
>
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
>
|Business01 00:50:E4:1E:0E:15|
>
|Business02 00:50:E4:1E:1C:6F|
>
|Business03 00:50:E4:AE:0E:3D|
>
|Business04 00:50:E4:CE:22:4F|
>
|Business05 00:50:E4:1E:E4:3E|
>
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
>
>
This is just part of the file (the /\/\/ bit is supposed to be a torn edge
>
eg there is more to the file)
>
>
I need applescript to read the file and search for a string (the Ethernet
>
address) and return the name of the machine as the result (I may have to
>
reverse it eg. first the Ethernet address then the name if it would be
>
easier) the Ethernet address is separated from the name with a tab.