<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small">Hi Dick,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I'm not sure whether I understand the details of your explanation, but clearly: it's you who should write the code that you describe. </div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Until then, shall I go and download cocoAspell and try the Applescript Macro provided by herb and Micheal Sharpe. I'm a little bit worried about mixing up some of the settings of Mac Spelling and TeXShop. And this is just for a single file of 3 pages in Bulgarian. (the Ministry of Education and Sciences of Bulgaria wants it in Bulgarian, instead in English!) Few months ago I tried to spell check another .tex file with Bulgarian text and, during the process, I deleted cocoAspell. That messed up the spelling in TeXShop and in Aquamacs. Win Treese helped me to restore the default spelling by NSSpellChecker: and that was not easy.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Actually, what I want with the bg... (bulgarian) dictionaries, for this .tex file of 3 pages in the typeset pdf, is hyphenation provided by these dictionaries, hopefully. The three pages of the typeset pdf now look very ugly, with heavily rugged right-hand sides. I guess I can manage the spell checking from Word, even if I'm clumsy with it.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">But better we get the ispell dictionaries to work with TexShop. And also with cocoAspell. I'll start reading Herb's instructions and will try to download cocoAspell. Maybe, until i manage, meanwhile you'll get the code that you describe :)</div><div class="gmail_default" style="font-size:small"><br></div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Best Regards,<br>Roussanka<br><div class="gmail_default" style="font-size:small">t</div><br><br></div></div></div></div></div></div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Jun 5, 2021 at 10:27 PM Richard Koch <<a href="mailto:koch@uoregon.edu">koch@uoregon.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Folks,<br>
<br>
In macOS, there is a "class library" called Cocoa. Most macOS programs are written in Cocoa. <br>
<br>
TeXShop is written in Cocoa, and thus its editor is written using the NSTextEdit class in Cocoa. This NSTextEdit in turn calls the Cocoa class NSSpellChecker to spell check text.<br>
<br>
NSSpellCheck onsults Cocoa dictionaries to spell check words. However, NSSpellCheck has hooks which allow it to be overridden so it uses different dictionaries and different ways to search them. This is transparent to the user; if NSSpellCheck is overridden, then ALL Cocoa programs use the new spell check methods. <br>
<br>
CocoAspell by Anton Leuski is an example of this approach. It overrides NSSpellCheck to call its own dictionaries, and is LaTeX aware and HTML aware. CocoAspell comes with a control panel to activate or deactivate it. Cocoa programs are completely unaware of this overriding. So for example, TeXShop calls NSSpellCheck and that's all it knows; it doesn't know if NSSpellCheck itself or some other overriding program like cocoAspell does the spell checking.<br>
<br>
Therefore it is misleading to say that TeXShop or any other program "uses the standard macOS spelling program via NSSpellChecker" because maybe that standard code is used directly, or maybe it has been overridden by something else. <br>
<br>
It is also possible for Cocoa programmers to completely ignore NSSpellCheck and invent their own spell checking procedure, but this is hard work and prone to error. TeXShop actually provides this; under the Source tab of TeXShop Preferences, the three "Spell Checking" items at bottom right activate forms of this alternate way to spell check. However, I do not recommend using these commands (!!!)<br>
<br>
Installing the Unix code for ispell or aspell, or a dictionary for one of these, will not affect a Cocoa program like TeXShop unless code is added to the program to use this extraneous spell checker. That is not an easy task.<br>
<br>
The preferable approach is to write code which hooks into NSSpellCheck and overrides it, and then calls the Unix ispell to spell check. That isn't an easy task either, but once it is done, then ALL Cocoa programs can use the new spell checking method without adding a line of code to them.<br>
<br>
Richard Koch<br>
<br>
<br>
----------- Please Consult the Following Before Posting -----------<br>
TeX FAQ: <a href="http://www.tex.ac.uk/faq" rel="noreferrer" target="_blank">http://www.tex.ac.uk/faq</a><br>
List Reminders and Etiquette: <a href="https://sites.esm.psu.edu/~gray/TeX/" rel="noreferrer" target="_blank">https://sites.esm.psu.edu/~gray/TeX/</a><br>
List Archives: <a href="http://dir.gmane.org/gmane.comp.tex.macosx" rel="noreferrer" target="_blank">http://dir.gmane.org/gmane.comp.tex.macosx</a><br>
<a href="https://email.esm.psu.edu/pipermail/macosx-tex/" rel="noreferrer" target="_blank">https://email.esm.psu.edu/pipermail/macosx-tex/</a><br>
TeX on Mac OS X Website: <a href="http://mactex-wiki.tug.org/" rel="noreferrer" target="_blank">http://mactex-wiki.tug.org/</a><br>
List Info: <a href="https://email.esm.psu.edu/mailman/listinfo/macosx-tex" rel="noreferrer" target="_blank">https://email.esm.psu.edu/mailman/listinfo/macosx-tex</a><br>
</blockquote></div></div>