• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: More Mac Ghost
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: More Mac Ghost


  • Subject: Re: More Mac Ghost
  • From: "Christopher C. Stone" <email@hidden>
  • Date: Tue, 21 Nov 2000 23:37:48 -0600

> 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.

Hey Phil,

There are quite a few ways to accomplish this:


-- Faux read file
set dta to "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"


-- Tanaka's Osax

set r to (MT Pick Lines dta keyword "00:50:E4:1E:E4:3E") as string
set AppleScript's text item delimiters to {tab}
set r to text item 1 of r
set AppleScript's text item delimiters to {""}
r


-- RegEx Commands Osax

set findString to "00:50:E4:1E:E4:3E"
set itm to REMatch dta pattern "(.+)\\t" & findString using "\\1"


-- Akua Sweets

set x to collect lines of dta that match "*00:50:E4:1E:E4:3E"
set x to item 1 of item 1 of (decompose x by tab)


Best Regards,

Chris

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Christopher C. Stone
StoneWorks Computer Consulting
email@hidden
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


References: 
 >More Mac Ghost (From: Phil APHS <email@hidden>)

  • Prev by Date: Re: Quark Paragraph Numbers and other QuarkNewbie Questions
  • Next by Date: Finding applications (Was: Smile - new window with propertie
  • Previous by thread: Re: More Mac Ghost
  • Next by thread: Re: More Mac Ghost
  • Index(es):
    • Date
    • Thread