[OS X TeX] Mimicking BBEdit's glossary items in TeXShop
Claus Gerhardt
gerhardt at math.uni-heidelberg.de
Mon Oct 30 10:17:02 EST 2006
Here is a script that doesn't need BBEdit. It is very fast, you won't
notice the opening and closing of the corresponding file.
Claus
--AppleScript
-- Apply only to an already saved file
-- Claus Gerhardt, October 2006
(*This script pastes the text in the file "~/Documents/fileName"
into the front most document in TeXShop at the position of cursor.
Enable access for assistive devices in "Universal Access" has to be
checked in the System Preferences.*)
--on paste()
set fileName to "myName" --enter fileName
set scriptPath to (do shell script "dirname " & "~/Documents/ex")
set scriptPath to scriptPath & "/" & fileName
set theFile to scriptPath as POSIX file
tell application "TeXShop"
open the file theFile
tell application "System Events"
tell process "TeXShop"
keystroke "a" using command down
end tell
end tell
tell application "System Events"
tell process "TeXShop"
keystroke "c" using command down
end tell
end tell
close document fileName saving no
tell application "System Events"
tell process "TeXShop"
keystroke "v" using command down
end tell
end tell
end tell
--end paste
------------------------- 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 Archive: http://tug.org/pipermail/macostex-archives/
More information about the MacOSX-TeX
mailing list