[OS X TeX] TeXShop wish list

Wolter Rose whrose at gmail.com
Sat Apr 30 14:41:11 EDT 2005


> 3. Likewise, it would be nice to get at the TeXShop console window
> without mousing to a menu to get it. Textures had Command-<zero> to
> do this. I use the console window to keep track of information
> gathered during the TeX run, which currently requires a lot of mousing.

The AppleScript at the bottom of this email will get you to the
console window belonging to the .tex or .pdf file you have as
frontmost when you trigger the script (use a keyboard shortcut utility
to call the script).

HTH,

Wolter

The AppleScript (I have done my best to make short lines so that one's
email program does not cut off long lines; if the script does not
compile in Script Editor, replace the offending linebreaks by a
space):

-- > BEGINNING check UI elements enabled
-- YOU CAN OMIT THE LINES BELOW
-- IF UI ELEMENTS IS ENABLED ON YOUR SYSTEM
tell application "System Events"
       activate
       get system attribute "sysv"
       if result is greater than or equal to 4144 then -- Mac OS X 10.3.0
               if (not UI elements enabled) then
                       beep
                       display dialog "GUI Scripting is not enabled" & ¬
                               return & return & "Open System Preferences" & ¬
                               " and check Enable Access for Assistive
Devices" & ¬
                               " in the Universal Access preference
pane, then" & ¬
                               " run this script again." with icon stop
                       if button returned of result is "OK" then
                               tell application "System Preferences"
                                       activate
                                       set current pane to pane ¬
                                              
"com.apple.preference.universalaccess"
                               end tell
                       end if
                       return
               end if
       else
               beep
               display dialog "This computer cannot run this script" & ¬
                       return & return & "The script uses GUI
Scripting technology" & ¬
                       ", which requires an upgrade to Mac OS X 10.3" & ¬
                       " Panther or newer." with icon caution buttons {"Quit"} ¬
                       default button "Quit"
               return
       end if
end tell
-- > END check UI elements enabled
-- YOU CAN OMIT THE LINES ABOVE
-- IF UI ELEMENTS IS ENABLED ON YOUR SYSTEM

tell application "TeXShop"
       activate
       set source_file to get name of window 1
       if source_file ends with ".tex" or ¬
               source_file ends with ".pdf" then
               set console_window to ¬
                       ((characters 1 through -5 of source_file) as string) & ¬
                       " console"
               tell application "System Events"
                       tell process "TeXShop"
                               -- GUI Scripting statements:
                               click menu "Window" of ¬
                                       menu bar item ¬
                                               "Window" of menu bar 1
                               keystroke console_window
                               keystroke (ASCII character 3) -- enter key
                       end tell
               end tell
       end if
end tell
--------------------- 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