Disabling IP addresses via Script

Dear Mates,

I need to create a script as below:
I have three IP addresses on an interface, I need a script that checks the enabled IP then enable the second and disable the first.
Lastly the if the IP enabled is the third, the script enables the first IP then disables the last.

Thanks in advance,
Bilal

If you would have posted the reason why you need it would much easier to answer you accordingly. any way try this.just example

/ip address
 :if ([get [find comment="ether1_wan_ip_1"] disabled] = false) do={
disable [find comment="ether1_wan_ip_1"]
enable [find comment="ether1_wan_ip_2"]
} else={
:if ([get [find comment="ether1_wan_ip_2"] disabled] = false) do={
disable [find comment="ether1_wan_ip_2"]
enable [find comment="ether1_wan_ip_3"]
 
} else={
:if ([get [find comment="ether1_wan_ip_3"] disabled] = false) do={
disable [find comment="ether1_wan_ip_3"]
enable [find comment="ether1_wan_ip_1"]
}
}
}

& so on … e.g