script error for wan ip info

I have Wan interface with 4 ips (means 4 ips are assigned to single interface and only one ip is active rest are disabled)
I am using followign script to print WAN ip in LOG window

:global externalInterface "ether1"
:local currentIP
:set currentIP [/ip address get [find interface="$externalInterface"] address]
:log warning "$currentIP"

But when I execute the script, I get this error in terminal

interrupted
           invalid internal item number

When I select LAN interface which have only one IP, it prints the ip ok,
I want to print wan ip which is active at a moment

I tried following script, but it prints all the IP addresses assigned to WAN interface, even the disabled ones. I want to print only active (enabled) IP address.

:global ifs [/ip address find interface="ether1"]
:local ifips ""
:foreach ifip in=$ifs do={
   :if ( $ifips = "" ) do={:set ifips "$[/ip address get $ifip address]"} else {:set ifips "$ifips \n$[/ip address get $ifip address]"}
}
:log warning ($ifips)

check this:

/ip address
:foreach i in=[ find interface=wan] do={
:local ip [get value-name=address $i]
:local status [ get value-name=disabled $i]
:if ($status = false) do={
:log error “ip address $ip”
}
}

change the interface name..

Working Great Thanks man. I want to give but where the Add KARMA option have gone in this new theme of mikrotik php forum ?

You need to switch the theme.