[OS X TeX] BBEdit and TeXniscope

Ramon M. Figueroa-Centeno ramonf at hawaii.edu
Fri Nov 26 03:21:59 EST 2004


Here is my script fro BBEdit and TeXniscope (it is self-contained):

tell application "BBEdit"
    set texFile to the file of active document of text window 1
    set texFile to POSIX path of texFile
    if the texFile ends with ".tex" then
        set TeXline to the startLine of selection of text window 1
        set baseName to (do shell script "basename " & texFile & " .tex") as
string
        set dirName to (do shell script "dirname " & texFile) as string
        try
            set PDFfile to ((POSIX file dirName as string) & ":" & baseName
& ".pdf") as alias
        on error
            display dialog "No PDF file was found!" & return & "Did you run
pdfLaTeX?" buttons {"OK"} default button 1 with icon stop
            return
        end try
        tell application "TeXniscope"
            activate
            open PDFfile
            refresh of the front document
            the front document goto line TeXline of source texFile
        end tell
    end if
end tell

-- 

Ramón M. Figueroa-Centeno, Ph.D.
Assistant Professor

Mathematics Department
University of Hawaii at Hilo
College Hall 4-A
200 W. Kawili St.
Hilo, HI 96720-4091

(808) 974-7387 (office)
(808) 933-3473 (fax)

http://www2.hawaii.edu/~ramonf/



--------------------- Info ---------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
           & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Post: <mailto:MacOSX-TeX at email.esm.psu.edu>





More information about the MacOSX-TeX mailing list