Get Multiple Mac Address

Hi all,

I know how to retrieve a Ethernet mac Address:

set nic_address to do shell script “ifconfig en0 | grep ether | cut -b "8-24"”

But suppose to get all Mac Address of a Mac that can have multiple Ethernet Card or Airport Mac Address (example MacBook Air don’t have en0 without Ethernet Adapter).

I would like to populate an array with every possible MacAddress.

Some Unix geek can help me?


Hi Hagi,

This should give you all ethernet Mac addresses:-

set nic_addresses to paragraphs of (do shell script "ifconfig | grep ether | cut -d ' ' -f2")

This does work for multiple ethernet ports. Not sure about Airport and not sure how you will work out which address is for which port?