[OS X TeX] Applescript TeXShop crashing bug

Ramón Figueroa-Centeno ramonf at hawaii.edu
Mon May 31 23:47:03 EDT 2010


A typo in a script led to the following little discovery:

tell application "TeXShop"
	set length of selection of the front document to -5
end tell

(you must have an open document, and in my test I had nothing selected and
there where at least 50 characters before the insertion point, but I do not
know if that makes a difference).

This will crash TeXShop 2.33 on cue. So in my script that takes user input,
I must do range checking!

I think that there should be one of two fixes:
1. ignore negative selection lengths.
2. select, in my example, 5 characters backwards, which is reasonable
because if we replace -5 by 5 I get five characters selected.

Mahalo for your patience,

View this message in context: http://macosx-tex.576846.n2.nabble.com/Applescript-TeXShop-crashing-bug-tp5124389p5124389.html
Sent from the MacOSX-TeX mailing list archive at Nabble.com.

More information about the MacOSX-TeX mailing list