MacOS auto correction

Hello community,

reading since years your discussions here, it’s time for my first request.

At first, a little bit context about my project:
I’m developing a for my maker projects a software on esp32 to drive several stepper motors, the drive commands are send via tcp as a RPC-standarized JSON-Object from XOJO to the ESP.
The software development for the ESP is made with support from a local LLM on my Mac. My problem: I’m testing all commands with AI-genrerated commands (JSON objects), which I copy from the LLM to a desktopTextArea in Xojo.
Unfortunately: The auto correction in the TextArea tries to correct me. As in Germany we use lower and upper quotations marks, TextArea changes every time(!) the first upper quotation to the lower quotation mark, every time I copy the JSON into the text area. When I change the equation mark, MacOS set every change back. When I send the Json-String to the ESP, it’s obviously wrong.

Of course: It should be possible to change the ascii.code before sending the string, but maybe one of you know a possibility how to deactivate autocorrection (just for this control)? Maybe Xojo has a kind of control without the OS influence?

Thank you in advance for your help!

You can turn this off in System Settings:

Hi Beatrix,

thank you for this hint. During my test cases, it’s a suitable solution. I will use it.
For other purposes, it’s a mess that this changes will shut down every auto correction.

Does this option not work on your system?

This should help for disabling those “helpful” auto corrections.

declare function NSClassFromString lib "Cocoa" (aClassName as CFStringRef) as Ptr

declare function documentView lib "Cocoa" selector "documentView" _
(obj_id as Ptr) as Ptr

declare sub setAutomaticQuoteSubstitutionEnabled lib "Cocoa" _
selector "setAutomaticQuoteSubstitutionEnabled:" _
(id as ptr, value as Boolean)

declare sub setAutomaticDashSubstitutionEnabled lib "Cocoa" _
selector "setAutomaticDashSubstitutionEnabled:" _
(id as ptr, value as Boolean)

declare sub setAutomaticTextReplacementEnabled lib "Cocoa" _
selector "setAutomaticTextReplacementEnabled:" _
(id as ptr, value as Boolean)

dim myTextArea as ptr = documentView(me.Handle)

setAutomaticQuoteSubstitutionEnabled(myTextArea, false)
setAutomaticDashSubstitutionEnabled(myTextArea, false)
setAutomaticTextReplacementEnabled(myTextArea, false)

If you have MBS it’s even easier

dim n as NSTextViewMBS = me.NSTextViewMBS
n.AutomaticQuoteSubstitutionEnabled = false
n.AutomaticSpellingCorrectionEnabled = false
n.AutomaticTextReplacementEnabled = false
n.AutomaticDashSubstitutionEnabled = false
n.AutomaticLinkDetectionEnabled = false
n.AutomaticDataDetectionEnabled = false