I use emacs and Emacspeak on my Mac because I can get indentation level announcements. This is vital for doing Python programming. Is it possible using apple scripts or something else to have VoiceOver automatically turn off when I open up emacs and then turn on again when I leave emacs? I looked in the VoiceOver activities but all I could find in there was to mute speech which is what I do not need. I need to actually turn VoiceOver off.
Can you send a keypress?
At one point in the distant past, I had an Apple Script that sent a Command+F5 keypress to turn off VoiceOver. This worked for a while, then stopped working after a MacOS upgrade. If you try it, let me know whether you get it working or not.
Triggering Your Script
You could write an AppleScript to turn off VoiceOver but the issue will be how to trigger that script to run. That's where the VoiceOver activities (which you have already identified won't do what you want to do) or something like that is needed. I would look at Keyboard Maestro to see if it had a trigger that would work. Of course triggering a script with a keystroke will be of no use because you can already toggle VoiceOver on and off with command-f5.