All I've really done is to move some things around; note the use of
evalto allow shell variables to be referred to before they are defined. The script behaves the same. That's fine, the goal for the moment it just to refactor for some later behavioral changes, not to make those behavioral changes now.
The behavior of the script provided by Al Kasprzyk can be produced by the above script by changing just the line defining
VIEWER. That line becomes
Nothing else need be changed; we now can compile our LaTeX file and see the resulting PDF in Skim.
To incorporate this into the SubEthaEdit mode, we do need to have the AppleScript pass the line number to the shell script. For now, I'll omit showing the AppleScript, since the essential changes are minor. I'll take a closer look at the AppleScript next time.
Update: I've renamed the
LINENUMvariable in the script to
LINE. This is just to be more symmetric with how applications like PDFView and Skim work with pdfsync.