[OS X TeX] Damn Applescript!

Stefan Walsen stefan at walsen.net
Wed Sep 28 05:36:16 EDT 2005


Hi Herb,

Herbert Schulz wrote:
> Quite a while ago (using software time, not geological time here) I  put 
> together, with a bunch of help from this list, the following  macro to 
> ``Find Next "Tab"'' (where "Tab" is an embedded bullet  character, `•', 
> in a command completion)
[...]
> Recently I was asked to also delete that "Tab" character with an  
> example where that would be handy (saves pressing Del in certain  nested 
> environments with my completions). I tried using the line
> 
> delete the selection of the front document
> 
> after the
> 
> set length...
> 
> line but that didn't work. I'm amazed at the strange, seemingly  random, 
> syntax of Applescript but maybe that's my age showing since  I'm used to 
> procedural languages (I loved C). Any help here would be  appreciated! 
> Supposedly `delete' is a verb in TeXShop's  Applescript  dictionary and 
> I'd think that `selection of the front document' would  be a decent noun 
> so...

Well, yes, but... you don't really want to delete the selection, do you? 
  you want to delete its *content*. Otherwise, the next time you say
  'set offset of selection of front document to (firstOccurrence - 1)' 
(or something similar), AppleScript says 'What selection? You mean the 
one you just deleted? That's gone.' ;)

You could, of course, also say 'set content of selection of front 
document to ""', or even 'set selection of front document to ""'. 
Although I don't know why the last statement works. :)

HTH,
Stefan
------------------------- 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