• 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: Remove colon from MAC adress
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Remove colon from MAC adress (From: Arnold Nefkens <email@hidden>)

  • Prev by Date: Remove colon from MAC adress
  • Next by Date: Scripting of Data Detectors again in OS X 10.5?
  • Previous by thread: Remove colon from MAC adress
  • Next by thread: Scripting of Data Detectors again in OS X 10.5?
  • Index(es):
    • Date
    • Thread