Testing/Checking Result Against Wi-Fi Password

Hi, I’m building an application that asks for a WPA2 password (Wi-Fi) password. The question comes up in a dialog box where you can input hidden text. I’m trying to get the text returned of that text box to check against the actual Wi-Fi password that is held within keychain for the given network name. That way, if there is an error then it will repeat the dialog box and prompt for the password again, but if there is no error, then it will continue to the next step.

I was also wondering if there was a way to make the text displayed in a normal dialog box “BOLD.”


Model: MacBook Pro M1
AppleScript: AppleScript (2.7)
Browser: Safari 605.1.15
Operating System: macOS 10.14

Hidden passwords you can’t get any way. And this is good for other users.

But you can get hidden passwords to script, firstly showing them:

tell application "System Events" to tell application process "WiFiAgent"
	tell window 1
		tell checkbox "Show password" to if its value = 0 then click it
		set thePassword to value of text field 1
		tell checkbox "Show password" to if its value = 1 then click it
	end tell
end tell

display alert thePassword