Network Status Led

In Network preferences>Network Status, there is Green/Yellow led-icon. Is there any way for AppleScript to detect what color it is without GUI scripting?

Presuming that you just want to know which interface is active, you can get that from ifconfig.

Sometimes when Mac connects to hotspot automatically when booted, it connects to it but that led is yellow so net dont work. Text says something that has self assigned IP. I want to detect that so i can fix it.

BTW, is anybody made script that somehow repeatedly tries to connect to x hotspot that has weak signal and gives annoying “There was an error joining the AirPort network “zzz”.” Try Again/OK -error?

Self-assigned IP addresses start with 169. You could check for that.