Disabling/Enabling a specific entry in an Address List

WebFig has a “Address Lists” page in the menu IP → Firewall → Address Lists.

That page offers to disable/enable an entry.
How do I perform the same disable/enable mechanism - but using a script?

I searched in the relevant wiki:
https://wiki.mikrotik.com/wiki/Manual:IP/Firewall/Address_list
but there’s no such option..

The easiest way is to add comment to the entry … and then toggle disabled flag by searching the comment. E.g.

/ip firewall address-list
add address=192.168.88.88/32 list=somelist comment="My address #1"

# from some script set the address list entry disabled
/ip firewall address-list set [ find comment="My address #1" ] disabled=yes

# ditto to enable it

You can even enable or disable number of address list entries if they have same comment set. You can use other properties in [ find … ] construct, such as list name …

Works like a charm.

For completeness I’d add that “write” policy should be enabled.

You can also use the IP part to find it, like:

/ip firewall address-list set [ find address=192.168.88.88/32 ] disabled=yes