Re: Words of Bug in Leopard (Japanese environment)
Re: Words of Bug in Leopard (Japanese environment)
- Subject: Re: Words of Bug in Leopard (Japanese environment)
- From: Jon Pugh <email@hidden>
- Date: Tue, 5 Aug 2008 23:49:32 -0700
At 11:20 PM -0700 8/5/08, Christopher Nebel wrote:
>Basically, don't use "word" elements to process anything other than natural language text. In your case, you probably want text items breaking on ":".
I think I should plug my SmartString library again:
http://www.seanet.com/~jonpugh/software/SmartString.applescript
With it, you could write this in this simple to understand form:
set aMacAdrStr to (do shell script "ifconfig en0 | grep 'ether'")
tell SmartString
setString(aMacAdrStr)
keepBetween("ether ", " ")
getTokens(":")
end tell
returns:
{"00", "17", "f2", "01", "ce", "96"}
Frankly, it makes string munging easier than grep for us english-like folks.
Jon
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden