[OS X TeX] Mojave and Applescript

Herbert Schulz herbs at wideopenwest.com
Thu Oct 11 21:57:52 CEST 2018

> On Oct 11, 2018, at 1:41 PM, Claus Gerhardt <claus.gerhardt at uni-heidelberg.de> wrote:
> As Dick recently mentioned Mojave places some restrictions on the actions ASs are allowed to perform. Today I found out that normal applications aren't allowed to send keystroke via AS, only System Events is allowed to do this. Below is an example.
> By the way, I had to replace the graphics card of my old Mac Pro 5.1 by a Sapphire Pulse RX 580 in order to install Mojave. This has the additional benefit that I can then also use the 5K display by LG the 3WK95U which has a Thunderbolt as well as a DP1.4 port. The Sapphire card also has a DP1.4 port which offers the necessary band width.
> Claus
> --AppleScript direct
> -- Apply only to an already saved file
> -- Claus Gerhardt, September 2006
> --set insertText to "pdflatex"
> --%&pdflatex %&pdflatex set pasteText to "%&" & insertText & " "
> tell application "TeXShop"
> 	activate
> 	tell application "System Events"
> 		--tell process "TeXShop"
> 			keystroke "%&"
> keystroke "pdflatex "
> 		--end tell
> 	end tell
> end tell


Under Mojave the first time you run a macro that has to send an AppleEvent for any reason (e.g., to another application like Finder or Terminal) you will be asked to allow ApplEvents and then you'll get another dialog to allow communication with the other application. That happens once for AppleEvents and each new application. Allow it!!! If you don't you will not be asked again. 

You can see what you've allowed by looking under Privacy in the Security & Privacy Tab of System Preferences. Look under Automation. At this time there is no way to get to re-do this without having to redo every app on the list again; i.e., completely removing the database that stores that information. One hopes that will get fixed in later updates to Mojave.

By the way, I've really gotten used to Dark Mode. There still are some bugs, at least on my system: The Ogrekit Find Panel's Find Pane is showing white type on a white background while the Replace Pane is fine, with black type on a white background. I've been told others aren't seeing this problem so...

Good Luck,

Herb Schulz
(herbs at wideopenwest dot com)

----------- Please Consult the Following Before Posting -----------
TeX FAQ: http://www.tex.ac.uk/faq
List Reminders and Etiquette: https://sites.esm.psu.edu/~gray/tex/
List Archives: http://dir.gmane.org/gmane.comp.tex.macosx
TeX on Mac OS X Website: http://mactex-wiki.tug.org/
List Info: https://email.esm.psu.edu/mailman/listinfo/macosx-tex

More information about the macostex-archives mailing list