[OS X TeX] Applescript in TS

Herbert Schulz herbs at wideopenwest.com
Thu Aug 9 14:54:22 CEST 2018


> On Aug 9, 2018, at 7:19 AM, Themis Matsoukas <tmatsoukas at icloud.com> wrote:
> 
> I am using this applescript to run Excalibur on the front window of TS:
> 
> -- Applescript direct
> 
> tell application "TeXShop"
> 	activate
> 	get path of document of window 1
> 	set fileName to result
> 	save fileName
> end tell
> do shell script "open -a " & "/Applications/TeX//Excalibur-4.0.7/Excalibur.app " & quoted form of fileName
> 
> I want applescript to save the TS file before running excalibur, otherwise excalibur will use the last saved copy. My problem is that the naive "save fileName” which I added right before "end tell”  does not do the job (although the script runs without errors). Can someone tell me what is the correct way to save the file?
> 
> Thanks,
> 
> Themis

Howdy,

A while ago Micheal Sharpe wrote a macro that saves the file (to make sure the latest version of the file is spell checked), runs Excalibur on the file and, after Excalibur quits, re-opens the file in TeXShop so you automatically replace the edited file with the update. It uses a shell script to do the command line processing. I enclose the macro .plist file and shell script.

To install the macro open the Macro Editor (Macros->Open Macro Editor…) which also adds the Macros->Add macros from file… menu item to the Macros menu. Click on that menu item and drag and drop the enclosed ExcaliburSpellcheck.plist file onto the dialog box and press Open to add it to the bottom of the macro list on the left side of the editor. You can then move it in the menu to a desired location.

The xcalb script is placed in ~/Library/TeXShop/bin. You can use the TeXShop->Open ~/Library/TeXShop menu item and then simply drop the script into the bin folder.

Again... thanks go to Micheal Sharpe for this macro.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Excalibur Macro.zip
Type: application/zip
Size: 2057 bytes
Desc: not available
URL: <https://tug.org/pipermail/macostex-archives/attachments/20180809/7b17c361/attachment-0001.zip>
-------------- next part --------------


Good Luck,

Herb Schulz
(herbs at wideopenwest dot com)


-------------- next part --------------
----------- Please Consult the Following Before Posting -----------
TeX FAQ: http://www.tex.ac.uk/faq
List Reminders and Etiquette: https://sites.esm.psu.edu/~gray/tex/
List Archives: http://dir.gmane.org/gmane.comp.tex.macosx
                https://email.esm.psu.edu/pipermail/macosx-tex/
TeX on Mac OS X Website: http://mactex-wiki.tug.org/
List Info: https://email.esm.psu.edu/mailman/listinfo/macosx-tex


More information about the macostex-archives mailing list