[OS X TeX] Number of pages with AppleScript in TeXShop

Peter Dyballa Peter_Dyballa at Web.DE
Wed Oct 19 00:10:46 CEST 2005


Am 18.10.2005 um 23:23 schrieb Maarten Sneep:

> # find the real master file (TeXShop 2.0 Style first)
> sourcedoc=`awk -F= '/^%!TEX *[Rr]oot/{print $2}' < $frontdoc`
>
> # if the new method didn't give a result, try the old method:
> if [ "$sourcedoc" = "" ]; then
>     sourcedoc=`awk '/^%SourceDoc/{print $2}' < $frontdoc`
> fi
>
> I realise just now that this only works on files without spaces in 
> their names. How does TeXShop do this (does it actually work?) I guess 
> I should be using sed or cut to get the correct value. OK, we'll add a 
> statement that support for filenames with spaces is limited.
>

Maarten, you shouldn't worry! Just try another method: sed -e 
's/^%SourceDoc *//' ... $frontdoc needs double quotes.

--
Greetings

   Pete

Remember: use logout to logout.

------------------------- 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 macostex-archives mailing list