[OS X TeX] Can a TeXShop engine give the PDF name?
Michael Sharpe
msharpe at ucsd.edu
Wed Dec 4 17:34:47 CET 2013
On Dec 3, 2013, at 4:30 PM, Michael Sharpe <msharpe at ucsd.edu> wrote:
> Though AppleScript can appear flaky, and does indeed change from one version of OSX to another, there is usually a workaround. One of the things that changed a couple of updates ago is that Open in the TeXShop dictionary now leads to error -1712, for reasons I can't explain. If you change your script to catch the error, it will work reliably. Eg,
>
> #!/bin/tcsh
>
> osascript << EOF
> tell application "TeXShop"
> try
> open posix file "$cwd/foo.pdf"
> activate
> set index of window "$1:foo.pdf" to 1
> tell document "$1:foo.pdf" to refreshpdf
> on error
> end try
> end tell
> EOF
Sorry---that should have been
#!/bin/tcsh
osascript << EOF
tell application "TeXShop"
try
open posix file "$cwd/foo.pdf"
on error
end try
activate
set index of window "$1:foo.pdf" to 1
tell document "$1:foo.pdf" to refreshpdf
end tell
EOF
Michael
More information about the macostex-archives
mailing list