[texshop] Macros with TS 4.14
Richard Koch
koch at uoregon.edu
Sun Nov 4 01:05:17 CET 2018
Folks,
This is a reply to two messages, from Juan Luis and Chris, complaining that Applescript sometimes failed in TeXShop 4.14.
Both messages were puzzling, because tests here showed that Applescript worked in 4.13, and there were no changes
to Applescript Macros in 4.14. Many macros still worked, but some did not. Moreover, nothing I changed in 4.14 had anything to do with Applescript.
Just now I figured it out. There is a file named TeXShop.scriptSuite which lists the special AppleScript commands understood by TeXShop. When I hardened the code for ScriptRunner.app (a step needed to send the code to Apple for virus checking before release), I accidentally modified XCode so it didn't add TeXShop.scriptSuite to the app Package.
This file has not changed for some time, so if you have a late version of TeXShop, like 4.01 or 4.13 or anything in between, you can fix the problem by reaching into this program, copying the missing file, and adding the copy to the 4.14 file bundle.
To see the contents of the TeXShop app, hold down the command key while clicking on TeXShop, and a contextual menu opens, One of the items is "Show Package Contents". This gives a standard Finder window showing the top level folder Contents. The missing file is
Contents --> Resources --> TeXShop.scriptSuite
I'll release 4.15 fixing this tomorrow or the next day. Thanks very much for your reports.
Dick Koch
> On Nov 3, 2018, at 10:55 AM, Juan Luis Varona Malumbres <jvarona at unirioja.es> wrote:
>
> Dick, I have installed TeXShop 4.14 today, and it seems that there is any problem with Macros menu.
>
> In the Macros menu, the items Program, Encoding and Root give an error message (but "Root (Short Version)" does not have any problem).
> I send to you a screen shot.
>
> I have removed the Macros folder to regenerate it without success.
>
> I do not know where is the problem. It does not happen with TeXShop 4.13.
>
> I have Mojave 10.14.
>
> Yours,
>
> Juan Luis
>
>
>
> <Screenshot.png>
>
>
FROM Chris Goedde
Hi,
Short version of my question:
Is there a way to tell a pdf in TeXShop to refresh via AppleScript in 4.14?
Long version:
I just updated to 4.14 from 4.01 (I think), and one of my engines that uses AppleScript has broken. I’m using 10.13.6. The full engine is:
######
#!/bin/tcsh
set path= ($path /usr/texbin)
pdflatex -jobname "$1:r-Ans" "$1"
osascript << EOF
tell application "TeXShop"
open posix file "$cwd/$1:r-Ans.pdf"
activate
set index of window "$1:r-Ans.pdf" to 1
tell document "$1:r-Ans.pdf" to refreshpdf
end tell
EOF
######
The line that breaks is “tell document "$1:r-Ans.pdf" to refreshpdf” with error:
235:245: execution error: The variable refreshpdf is not defined. (-2753)
Is there a way to make this work again, or should it work?
Thanks!
Chris Goedde
More information about the texshop
mailing list