Done! It works!
Well, it didn't work with the actual key combination from which my laptop is
supposed to control the brightness -I guess that might also be the cause of
the original problem. But it does work with other key combination.
My laptop is suposed to use Fn+Right to increase brightness and Fn+Left to
decrease it. When pressing those key combinations I have always been able to
see the increasing or decreasing brightness indication on screen, but never a
real change on brightness.
Your scripts didn't work with Fn+Right nor Fn+Left -and the brightness change
indication on screen has always kept working. But I tried with other
combination key and it worked ok. So now I use the Windows key instead of the
Fn key to change the brightness.
Thank you again. Yes, tinkering is great, I've learnt many things.
Cheers