Hi Aarestrups, the script looks good.... However if you are referencing the hard key power button then your widget declarations don't make sense based on this. You have widget("TvOff","TAG") in your script. If you are trying to reference the hard key power button, it's prontoscript name is "PS_POWER". Also is "TAG" the Prontoscript name of a page or activity?
Give CF.widget("PS_POWER").executeActions(); a try.
You can hide almost anything until you have to put the drywall up!