Re: Remove colon from MAC adress
Re: Remove colon from MAC adress
- Subject: Re: Remove colon from MAC adress
- From: "Mark J. Reed" <email@hidden>
- Date: Mon, 4 Feb 2008 14:25:08 -0500
On Feb 4, 2008 2:12 PM, Arnold Nefkens <email@hidden> wrote:
> set allInfo to system info
> set MacAdress to primary Ethernet address of allInfo as text
>
> But the variable MacAdress is set in the format 00:00:00:00 etc.
>
> Is there a way to remove the colon? We need the script to create a
> file wich has the Primary Eth HW adres in the name...
Text Item Delimiters to the rescue!
set savedTID to AppleScript's text item delimiters
set AppleScript's text item delimiters to ":"
set hexBytes to textItems of MacAdress
set AppleScript's text item delimiters to "-" -- or whatever you want
to replace the colons with)
set fileName to hexBytes as text
set AppleScript's text item delimiters to savedTID
--
Mark J. Reed <email@hidden>
_______________________________________________
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