The error was in the name of the code. It appears that the name is padded with a number of invisible characters. To find out therefore what the true name is, I ran the following command:
I don't know where these "invisible characters" came from.
Please note that at the bottom of the Action Editor there is a text field "Name for scripts". This field takes precedence over the action name. That's useful if you have special characters as code names, e.g. for "Volume Up...".
And, there's a popup menu at lower right which gives you a line of AppleScript right to be used. Please see this manual page for details.
Solution Found
The error was in the name of the code. It appears that the name is padded with a number of invisible characters. To find out therefore what the true name is, I ran the following command:
name of every Code of Device "Dream/Satellite TV" of Remote "Dream TV"
This gave me the following output:
{"mute ", "power ", ... etc
So I copied the content including the quotes for each of these codes and assigned them to the original script. It now works!
invisible characters?
I don't know where these "invisible characters" came from.
Please note that at the bottom of the Action Editor there is a text field "Name for scripts". This field takes precedence over the action name. That's useful if you have special characters as code names, e.g. for "Volume Up...".
And, there's a popup menu at lower right which gives you a line of AppleScript right to be used. Please see this manual page for details.