Problems with copying & pasting from a Word document into MZ as a script?

Ok, so I just spent an hour trying to figure out why a simple script in MZ wasn't working like I thought it was supposed to. I thought it was pretty straight forward:

$gameSelfSwitches.setValue([1, 1, 'A'], true);

Map ID is 1, Event ID is 1, and Self Switch being turned on is A.

But it wouldn't work.

I thought I was being clever by taking notes about scripts in a Word document that I could copy and paste later.

After an hour, I finally noticed that the quotes around the 'A' looked different in the script from other examples I had used in the past while recreating tutorials and typing the script in manually while following the tutorial. When I retyped the single quotes around the A, they looked correct and the event worked perfectly.

In the Word document, the single quotes are one down and one up by default. When I copied and pasted the script, it made the single quotes look almost like they were italicized. Maybe it was the font I was using in Word.

Has anyone else run across copy and paste problems with scripts? Where you copy and paste the correct script but it doesn't work. Yet if you type it in directly, it works correctly? Maybe due to font in Word or something?

Just wondering since it was driving me crazy and I was actually getting ready to post a question here to figure out why the script wasn't working.

Thanks!
Pro Tip: Use Notepad++. It's open source and free.
Keeps the formatting all aligned and everything, and you can open scripts / plugins in it to see how they work, or edit them for your own needs (if the author permits it).

Yeah, Word has a lot of auto-substitute things that would screw up your code. You can also see this if you type a hyphen (like 5 - 2) it will change it to a double-length dash character.

You could turn off all of these things in the options, but ultimately Word is a word processor, not a code editor. You can use Notepad in a pinch, but I also use Notepad++.

Original thread: https://forums.rpgmakerweb.com/threads/problems-with-copying-pasting-from-a-word-document-into-mz-as-a-script.145727/