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

Michael Sharpe msharpe at ucsd.edu
Fri Jun 25 15:29:10 EDT 2021


I couldn't get sync_to_preview to work, but following Dick's example in Changes to 4.24, it does work to use instead something like

tell application "TeXShop"
	set frontdoc to (document of window 1)
	tell frontdoc
		try
			--sync_to_preview theIndex 1 theLine 12 theName texfile
			sync_preview_line theLine 12
			sync_preview_index theIndex 1
			sync_preview_name theName texfile
		on error
			display dialog "help"
		end try
	end tell
end tell


> On Jun 25, 2021, at 10:51 AM, tkiffe <tom at kiffe.com> wrote:
> 
> 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"
> 	try
> 		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"
> 	activate
> 	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.
> 
> TIA,
> Tom
> 
> 
> ----------- Please Consult the Following Before Posting -----------
> TeX FAQ: https://urldefense.proofpoint.com/v2/url?u=http-3A__www.tex.ac.uk_faq&d=DwIGaQ&c=-35OiAkTchMrZOngvJPOeA&r=u80q3uxL9pTWIHtkmtNZRA&m=RcwnFnEa7GCQlEFms8NF3jwIyRHaNt5m2kyo4zxffP4&s=qBD4ZV8ZdRZQLpvrBE4t6elYfJ2R7pyF4J68buXdadM&e= 
> List Reminders and Etiquette: https://urldefense.proofpoint.com/v2/url?u=https-3A__sites.esm.psu.edu_-7Egray_TeX_&d=DwIGaQ&c=-35OiAkTchMrZOngvJPOeA&r=u80q3uxL9pTWIHtkmtNZRA&m=RcwnFnEa7GCQlEFms8NF3jwIyRHaNt5m2kyo4zxffP4&s=coDvkM7tLs2qmWXY9LwCEm-eS46L8SM47yn8VgRKdIo&e= 
> List Archives: https://urldefense.proofpoint.com/v2/url?u=http-3A__dir.gmane.org_gmane.comp.tex.macosx&d=DwIGaQ&c=-35OiAkTchMrZOngvJPOeA&r=u80q3uxL9pTWIHtkmtNZRA&m=RcwnFnEa7GCQlEFms8NF3jwIyRHaNt5m2kyo4zxffP4&s=4t4TeXt4AdvFcP02YOTJ8jQlOAVpjhRAxyGBUaJpCxg&e= 
>                https://urldefense.proofpoint.com/v2/url?u=https-3A__email.esm.psu.edu_pipermail_macosx-2Dtex_&d=DwIGaQ&c=-35OiAkTchMrZOngvJPOeA&r=u80q3uxL9pTWIHtkmtNZRA&m=RcwnFnEa7GCQlEFms8NF3jwIyRHaNt5m2kyo4zxffP4&s=koG76POHAGst9X35WFLadCMwSJYxRPkSyOA4gklzeis&e= 
> TeX on Mac OS X Website: https://urldefense.proofpoint.com/v2/url?u=http-3A__mactex-2Dwiki.tug.org_&d=DwIGaQ&c=-35OiAkTchMrZOngvJPOeA&r=u80q3uxL9pTWIHtkmtNZRA&m=RcwnFnEa7GCQlEFms8NF3jwIyRHaNt5m2kyo4zxffP4&s=g9x__uCsyTqKO6OVCYkQtRPoX925DhBo0CeTcxsi2Rc&e= 
> List Info: https://urldefense.proofpoint.com/v2/url?u=https-3A__email.esm.psu.edu_mailman_listinfo_macosx-2Dtex&d=DwIGaQ&c=-35OiAkTchMrZOngvJPOeA&r=u80q3uxL9pTWIHtkmtNZRA&m=RcwnFnEa7GCQlEFms8NF3jwIyRHaNt5m2kyo4zxffP4&s=cv7VxPTrrdAAE299ugXL15SnLFx5zviEOi-dK2Io2Bk&e= 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://email.esm.psu.edu/pipermail/macosx-tex/attachments/20210625/67d84818/attachment.htm>


More information about the MacOSX-TeX mailing list