[OS X TeX] Who Wrote These, Please?
David Watson
dewatson at mac.com
Mon Mar 20 23:22:53 EST 2006
On Oct 15, 2004, at 7:38 AM, Claus Gerhardt wrote:
> Below is an Applescript open_selection with the help of which one
> can open included files in TeXShop. The equivalent of the script I
> posted yesterday for BBEdit.
>
> However, BBEdit must still be installed and running.
>
> Furthermore, the do_menu.scpt must be installed in its proper place.
>
> Let me also mention that TeXShop didn't understand the command
>
> set theFile to (POSIX file filepath as alias)
>
> I had to pass this command to the Finder.
>
> Claus
>
> -- Applescript
> -- open_selection
> -- Apply only to an already saved file.
> -- Claus Gerhardt, Oct. 2004
>
> (* Select the name or the path of an included file, which is
> supposed to be a .tex file, then the script will tell TeXShop to
> open the file. BBEdit must be installed and running.*)
>
>
> tell application "Finder"
> set scriptPath to (do shell script "dirname " & "~/Library/
> TeXShop/Scripts/ex")
> set scriptPath to scriptPath & "/do_menu.scpt" as string
> set scriptName to POSIX file scriptPath as alias
> set scriptLiB to (load script scriptName)
> tell scriptLiB
> do_menu("TeXShop", "Edit", "Copy")
> end tell
> end tell
>
>
>
>
> tell application "BBEdit"
> activate
> set findName to (contents of current clipboard)
> end tell
>
> tell application "TeXShop"
> activate
>
> set fileName to #TEXPATH#
> set n to (number of characters of contents of fileName)
> set fileNamequoted to quoted form of fileName
> set baseName to do shell script "basename " & fileNamequoted
> set m to (number of characters of contents of baseName)
> set dirNameunquoted to (characters 1 thru (n - m - 1) of fileName
> as string)
> set filePath to (dirNameunquoted & "/"& findName &".tex")
> end tell
>
> tell application "Finder"
> set theFile to (POSIX file filepath as alias)
> end tell
>
>
> tell application "TeXShop"
> open theFile
>
> 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>
>
>
------------------------- 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