Setting Property for Item in Console

I’m sure someone can answer this question very easily. I’m embarrassed to have to ask it, but I don’t know the intricacies of the console like I should. I’m trying to change a value of an item’s property. For example In the address-list I would like to change the address list that 192.168.1.1 belongs to. I thought the following would work, but it doesn’t:

set [find where address=192.168.1.1] list=SPAMMER

What am I doing wrong? The Wiki is lacking in advanced topics such as this. I am trying to learn scripting, and need to know how to do this before I can continue.

Thanks guys

That syntax works for me. Maybe you’re not in the right context?

[admin@MikroTik] > /ip firewall address-list print where list=test
Flags: X - disabled, D - dynamic
 #   LIST                       ADDRESS
 6   test                       192.168.1.1
[admin@MikroTik] > /ip firewall address-list set [/ip firewall address-list find address=192.168.1.1] list=test2
[admin@MikroTik] > /ip firewall address-list print where list=test2
Flags: X - disabled, D - dynamic
 #   LIST                       ADDRESS
 6   test2                      192.168.1.1
[admin@MikroTik] >

My whole problem was I had “where” after “find”. I have corrected my code to the following:

set [find address=192.168.1.1] list=SPAMMER

It works! Thanks for your help! Great example. Now off to learn some more scripting…