[OS X TeX] PDF syncing from an external editor to TeXShop

tkiffe tom at kiffe.com
Fri Jun 25 19:51:02 CEST 2021

Howdy y’all,

I am using the following minimal Apple Script to sync from a source file to a PDF file in TeXShop:

set texfile to "/Users/tkiffe/Documents/textests/gentle.tex"
set pdffile to "/Users/tkiffe/Documents/textests/gentle.pdf"
set syncfile to "/Users/tkiffe/Documents/textests/gentle.synctex.gz"
tell application "/Applications/TeX/TeXShop.app"
		sync_to_preview pdffile theIndex 1 theLine 1992 theName texfile
	on error
		display dialog "help"
	end try
end tell

The values of the parameters theIndex, theLine, and theName were obtained through BBEdit and are valid.
When I run the script with gentle.pdf displayed in TeXShop, I get no error messages and nothing happens to the pdf file. I don’t know what the object of the sync_to_preview command should be. I have tried the pdf file, the tex file, and even the synctex.gz file. None of them work. TeXShop’s Applescript dictionary simply states

sync_to_preview: object of the command

which is not very helpful.

Here is a minimal example of an apple script which successfully typesets a file in TeXShop and displays the resulting pdf file

set texfile to "/Users/tkiffe/Documents/textests/gentle.tex"
tell application "/Applications/TeX/TeXShop.app"
	open texfile
end tell

In this case it is obvious that the object of the open command is the file to open. It is not obvious to me what the object of the sync_to_preview command should be. This applies to all 4 sync commands in TeXShop’s Applescript dictionary. Any help would be greatly appreciated.


----------- 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
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.