Script fails

hapac2 6.48.1

I’ve taken scripts from this forum to update ddns. I’ve checked that the ddns url works from a browser in the following format
[https://dynamicdns.park-your-domain.com/update?host=[host]&domain=[domain_name]&password=[ddns_password]&ip=[your_ip](https://dynamicdns.park-your-domain.com/update?host=[host]&domain=[domain_name]&password=[ddns_password]&ip=[your_ip)]

:

local password "thesecretkey1234"
:local subdomain "@"
:local domainn "mydomain.com"
:log info "Start DDNS $subdomain $domainn"
:local currentIP [/ip address get [:pick [/ip address find interface="SSEbb"] 0] address]
:log info "WAN IP:$currentIP"
:local url1 "https://dynamicdns.park-your-domain.com/update\3Fhost=$subdomain&domain=$domainn&password=$password&ip=$currentIP"
/tool fetch url=($url1) mode=https
:log info "DNS Successfully Updated"

The script appears to execute to line 4 as that is printed to the log.
From the terminal I’ve executed the get ip address and it does return the correct address/interface.

Aside from the above, if I execute the below line from terminal and then log/put the var it returns a blank string.

:local currentIP [/ip address get [:pick [/ip address find interface="SSEbb"] 0] address]

If SSEbb interface exist, and have at least one IP:

{
:local password  "thesecretkey1234"
:local subdomain "@"
:local domainn   "mydomain.com"
/ip address
:local arrayofID [find where interface="SSEbb"]
:local firstID   [:pick $arrayofID 0]
:local fulladdr  [get $firstID address]
:local address   [:pick $fulladdr 0 [:find $fulladdr "/" -1]]

:log info "Start DDNS $subdomain $domainn - WAN IP: $address"
/tool fetch url="https://dynamicdns.park-your-domain.com/update\3Fhost=$subdomain&domain=$domainn&password=$password&ip=$address"
:log info "DNS Successfully Updated"
}

Excellent! Thank you that does the job nicely.