You require something like SCXE or StarForge to use the AI Scripts necessary for the AI to nuke.
Run the AI Script "Fill Silos With Nukes Type 2" in a location over a computer controlled Nuclear Silo. The nuke must be affordable. It is best to set the cost to 0 minerals, 0 gas, and set the build time to 1. You should also make sure the computer has the necessary supply to build a Nuclear Missile (8 is required).
Now, use Create Units with Properties to make a cloaked Ghost for the computer somewhere. Run the AI Script in a location over the Ghost entitled something like "AI Nuke" or "Computer Nuclear Launch" (I forget the name of the AI Script)" If a Nuke was successfully built in the Nuclear Silo, then it should launch a Nuclear Missile at the location specified.
Kow that a Ghost will automatically uncloak itself once it has finished targetting the for the Nuke.