I am writing a simple AppleScript that will allow a user to see his/her wireless MAC address. This is what I have so far:
This is the result:
How can I set the script to display the result like this:
Oh, and the Clipboard part of the script is purely to help me paste the result of the script here. It does not need to be part of the final script.
Thankyou all in advance!
I would also like to allow the user to change his/her MAC address. I know the command that has to be run in order to do this:
But I don't know how to allow the user to simply type the new MAC address into a text box and have the above command be run with administrative privileges and with the MAC address the user has specified.
set WirelessMAC to ((do shell script "ifconfig en1 ether"))
display dialog "Would you like to display your MAC address?" buttons {"No", "Yes"} default button 2
if the button returned of the result is "Yes" then display dialog WirelessMAC buttons {"Clipboard", "OK"} default button 2
if the button returned of the result is "Clipboard" then set the clipboard to WirelessMAC
This is the result:
en1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ether 00:11:22:33:44:55
How can I set the script to display the result like this:
00:11:22:33:44:55
Oh, and the Clipboard part of the script is purely to help me paste the result of the script here. It does not need to be part of the final script.
Thankyou all in advance!
I would also like to allow the user to change his/her MAC address. I know the command that has to be run in order to do this:
sudo ifconfig en1 ether [New MAC Address]
But I don't know how to allow the user to simply type the new MAC address into a text box and have the above command be run with administrative privileges and with the MAC address the user has specified.