[OS X TeX] BBedit, pdfsync and PDFView

David Goldenberg goldenberg at biology.utah.edu
Tue Apr 17 19:51:17 EDT 2007


First of all, thanks to all of those who responded to my earlier 
question about BBEdit and LaTeX.  From the various suggestions and 
examples, I can now run pdfLaTex from BBEdit and see the result in PDFView.

Now, I'd like to be able to use pdfsync to move between BBEdit and 
PDFView (or another viewer).  There doesn't seem to be any problem going 
from PDFView to BBEdit, but I haven't been able to figure out how to go 
the other way.  The PDFView web page gives examples of scripts for 
TextMate and emacs, but not BBEdit.

Following the information on the PDFView web page, and after a good deal 
of fumbling around, I was able to get the following AppleScript to run, 
but it doesn't actually do much:

tell application "BBEdit"
	get file of window 1
	set filepath to result
	set fileName to POSIX path of filepath as string
	get startLine of selection of text of window 1
	set lineNo to result
	
	set pdfSyncComm to 
"/Applications/Utilities/pdfView/PDFView.app/Contents/MacOS/gotoline.sh 
" & lineNo & " " & fileName
	do shell script pdfSyncComm
end tell

The script returns the result:

"tell application \"PDFView\"
	display tex line 74 of file 
\"/Users/davidg/Documents/Work1/Courses/Biol-Chem-Phys_5810/2007/problemSets/probSet2_solns.tex\" 

end tell"

This looks like the gotoline.sh script provided with PDFView is running, 
but doesn't seem to elicit the correct response from PDFView.    Also, 
if PDFView isn't already open, the script causes it to launch, but not 
to open the file or go to the line.

I also tried incorporating the following directly into an AppleScript:

tell application "PDFView"
	display tex line lineNo file fileName
end tell

But, this gives the same disappointing result.

Has anyone been able to make this work?  Or is there a better way to get 
synching between BBEdit and a viewer?

Thanks again,
David Goldenberg

------------------------- Helpful Info -------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/
List Reminders & Etiquette: http://www.esm.psu.edu/mac-tex/list/





More information about the MacOSX-TeX mailing list