[OS X TeX] 1) Search source file when preview is active (`front'). 2) Incremental search

Nicolae Garleanu garleanu at haas.berkeley.edu
Sat May 24 22:02:56 CEST 2014

This strikes me as the ``right¹¹, direct way to go about it, rather than
trying to make use of other commands whose behavior is a bit unclear,
anyway. (In my case, cmd-f2 does appear to work, but I think that all
files opened since TexShop was last opened, including the ones closed
already (even the .plist kind), are included in the list that
(shft-)cmd-f2 circle through.)

There is, however, a very minor limitation. In practice it would not
affect me, b/c I would normally be in a pdf file I had just compiled, but
if I compile a file (A.tex), then click on another pdf (B.pdf) and run the
macro, then the search is performed in A.tex. In fact, the search seems to
take place in the .tex file that was active most recently, regardless of
compiling. Maybe that is the intended behavior? In other words, `document
1¹ may simply be the last active .tex file?

Finally and more important, now that I have several useful building
blocks, I could use the answer to this general question: Where can I find
a description of how to code in applescript the various key shortcuts I
would type in myself in TexShop? (E.g., cmd-click?) (I haven¹t installed
the developer version of Mavericks, in case you¹re wondering.)

Thanks again.

On 5/24/14, 10:13, "Michael Sharpe" <msharpe at ucsd.edu> wrote:

>tell application "TeXShop"
>	activate
>	set p to (path of document 1)
>	try
>		open p as POSIX file
>	on error errmsg number errnum
>		if not (errnum = -1712) then
>			display dialog "Error: '" & errmsg & "' trying to open document"
>		end if
>	end try
>	tell application "System Events" to keystroke "f" using command down
>end tell

More information about the macostex-archives mailing list