Now we're getting somewhere.
Some possibilities:
1. When you send text, the wrong window is active. This can be determined by activating Notepad before you trigger your
hotkey (as a test). Unless your script activates a window, waits for a window, specifies a target window in some other way, or uses a hotkey, the wrong window is likely to be active at any moment.
2. Your target window is elevated or blocks scripting. This can be determined if the script works in other windows. You can try UI Access (admin as a last resort). See documentation.
3. Your script exits or is terminated before you can notice anything. This can be determined by verifying that the script is still running.
a. Another program terminates your script.
b. Your script exits or ends itself.
The script that you posted is not persistent and so will exit when the end of the script is reached. A different script may have different results (as you saw from my script).
4. The script contains a bug.
Whenever I see a post that says, "My script worked yesterday but not today", it's usually because the author changed the script!