[OS X TeX] Macro(s) for using Excalibur with TeXShop?

Herbert Schulz herbs at wideopenwest.com
Mon Jul 14 19:05:17 CEST 2014


On Jul 14, 2014, at 7:54 AM, Herbert Schulz <herbs at wideopenwest.com> wrote:

> 
> On Jul 14, 2014, at 1:07 AM, Michael Sharpe <msharpe at ucsd.edu> wrote:
> 
>> 
>> On Jul 13, 2014, at 8:28 AM, Herbert Schulz <herbs at wideopenwest.com> wrote:
>> 
>>> Howdy,
>>> 
>>> I have always used CoCoAspell as my LaTeX-aware Spellchecker. Once set up it works seamlessly through the Apple Spelling system in TeXShop.
>>> 
>>> I'd like to add a section on Spell Checking to `TeXShop Tips & Tricks' and I know many folks out there use Excalibur as their LaTeX-aware Spellchecker. I assume that many of those folks use a work flow with  a TeXShop Macro set up to save a file, have Excalibur process that file and then ``re-open'' the processed file in TeXShop but I certainly may be wrong. Can folks that use Excalibur let me know how they work with it?
>>> 
>>> Are there any other LaTeX-aware spell checkers out there that folks are using (e.g., aspell by itself)? If so, what work flow is being used?
>>> 
>>> PS: CoCoAspell hasn't been updated in a long time and, with each release of a new OS I am afraid it will stop working at all. So far I've only had to re-install it once; when I switched from a PPC to and Intel machine quite a few years ago. I'd hate to lose it!
>>> 
>> 
>> I'm not a regular user of Excalibur but I can see it might be a useful adjunct to CoCoAspell, so here's an AppleScript Macro for it. The macro depends on a shell script located in ~/Library/TeXShop/bin, called xcalb (which must of course be made executable) with contents
>> 
>> #!/bin/bash
>> open -W -a Excalibur "$1"
>> open -a TeXShop "$1"
>> 
>> The AppleScript macro is very short:
>> 
>> --applescript
>> --Michael Sharpe, 2014/07/13
>> --Apply this macro only to a document that has been saved previously
>> --Close doc, saving if changed, open in Excalibur for spellcheck, reopen when Excalibur is quit
>> --Calls shell script xcalb in ~/Library/TeXShop/bin
>> 
>> set f to #FILEPATH#
>> 
>> set p to (POSIX path of (path to home folder)) & "Library/TeXShop/bin/xcalb "
>> tell application "TeXShop"
>> 	try
>> 	    close front document--saving if modified
>> 	end try
>> end tell
>> 
>> do shell script p & quoted form of f & " &"
>> 
>> Michael
>> 
> 
> Howdy,
> 
> Thanks for the macro. (Maybe) I'll test it out; but it looks simple enough.
> 
> But, I wonder... If you simply saved the front document, if modified, rather than closing the document (which would also close any associated Preview, etc.) would TeXShop update the document, with any changes, with the insertion point at the same location when the `open -a TeXShop ...` command was given? I guess that would have to do with how TeXShop treats documents when asked to open and document that is already open.
> 
> Whoa... I just did a small test. I created a document in TeXShop and saved it to a file. Without closing the document, I then opened it in BBEdit, changed some text and Saved the changes. When I went back to TeXShop those changes were already reflected in the displayed document! Seems that TeXShop and the text framework is really smart!
> 
> Good Luck,
> 
> Herb Schulz
> (herbs at wideopenwest dot com)

Howdy,

Just tried it using `save` instead of `close` and it all seems to work just fine! The insertion point disappears but the location in the file remains unchanged (at least with my simple tests).

Good Luck,

Herb Schulz
(herbs at wideopenwest dot com)






More information about the macostex-archives mailing list