Problem with script

Hi,
I need to delete a list of addresses using index number.
Using the command from the terminal works, example:

/ip firewall address-list remove numbers=6

but
but using it in a script does not work.
possible solutions?
Thanks!

may be “no such item”
use this command to see what is the output

:put [/ip firewall address-list remove numbers=6 ]

Index numbers are put in buffer after print command. You cannot blindly use these numbers in script.

Use find command instead, based on properties:

/ip firewall address-list remove [ find list=<name> address=<address> ]