That's because when you run it in Notepad++, you aren't passing any arguments.
Your script expects 3 arguments. When you run it from the command line, you are passing it three arguments.
When you run it from Notepad++, you haven't passed in any arguments. I don't currently have Notepad++ installed, but I'd guess under the "Run" filemenu there'd be an option to specific command-line arguments.