Kimpak Posted July 10, 2019 Posted July 10, 2019 Hello, I have an autoit program that has various keyboard shortcuts to make my job easier. One of the fuctions in the larger program converts a highlighted MAC address to make it lower case and in a xxxx.xxxx.xxxx format. It worked great for years, I have a new machine at work and its suddenly stopped working and I can't figure out why. I am not a programmer (I know networking). HotKeySet("^{`}", "macfix") ; format MAC addresses Func macfix() ClipPut ("") _SendEx("^c") $mac = ClipGet() $mac = StringLower($mac) ; convert to lower case if necessary $mac = StringRegExpReplace ($mac, "[^0-9a-f]", "") ; remove anything besides numbers and letters a-f If (StringLen ($mac) <> 12) Then MsgBox (0, "Error", "Invalid MAC address") ; check for correct number of characters Else $macSplit = StringSplit($mac, "") ; split mac apart, every character to a different position of the array Sleep (20) $mac = $macSplit[1] & $macSplit[2] & $macSplit[3] & $macSplit[4] & "." & $macSplit[5] & $macSplit[6] & $macSplit[7] & _ $macSplit[8] & "." & $macSplit[9] & $macSplit[10] & $macSplit[11] & $macSplit[12] ; recombine them into a valid mac address _SendeX ($mac) ; replace highlighted text with corrected mac address ClipPut ($mac) ; put new mac address in clipboard for easy pasting EndIf EndFunc The function will just return the 'invalid mac address' error even if its a valid string.
Earthshine Posted July 10, 2019 Posted July 10, 2019 so what changed at work, new computer? Windows 10? My resources are limited. You must ask the right questions
Kimpak Posted July 10, 2019 Author Posted July 10, 2019 Well...now its working. I don't see a way to delete my post.
Earthshine Posted July 10, 2019 Posted July 10, 2019 there is no way you can delete, it's ok. My resources are limited. You must ask the right questions
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now