Command runs in Terminal but not in Script

Hi,

Not sure if this is posted in the wrong place or not… and I have already solved my problem, but wanted to know if anyone else was having similar problems.

I have an RB4011 running ROS 7.12.1
I created a script for renewing the Let’s Encrypt certificate that I use for my SSTP VPN, which up until sometime in the last 4 months was working perfectly. Now however, since one of the recent ROS upgrades, it no longer works.
I ran all the lines of the script in Terminal, and they do exactly what they should do.
I then created a new “test” script where I copy/pasted each line one after another and ran the test-script after each new line.

It seems that this command:

/ip service enable [find where name=“www”]

can be run in the Terminal (and I can see in the IP->Services window in Winbox that the www service is indeed enabled), but cannot be run from a script.
To enable/disable an IP Service from a script, it seems you have to use:

/ip service set disabled=no [find where name="www"]

Whereas this command:

/ip firewall filter enable [find where comment="LetsEncrypt"]

(in my config, I have commented the firewall rule that open port 80 on the input chain with “LetsEncrypt”)

Works in both Terminal AND script.

Anyone else noticed this, is it by design for some reason or just a strange anomoly?

Thanks