[OS X TeX] Applescript changes in TS

Claus Gerhardt claus.gerhardt at uni-heidelberg.de
Sat Dec 31 10:00:23 CET 2011

Could you please check if a failing script would still work if it would be saved as subroutine or shell script (OSA script) outside TS and would only be called by a macro.


On Dec 31, 2011, at 7:37, Michael Sharpe wrote:

> I have a number of applescripts that work correctly from the Applescript Editor but fail with strange error messages when run from the TeXShop Macro Menu with header 
> --Applescript direct
> I tracked down two of the problems that were show-stoppers for me:
> (i) length no longer functions correctly with either strings or lists in the Macro Menu, though it does under Applescript Editor. You need to change all instances of length to count. (This affects several macros distributed with TeXShop.)
> (ii) offset is not functional under the Macro Menu (no problem under AppleScript Editor), and I replaced it in my macros with the function stroffset:
> on stroffset(find_str,whole_str) 
> 	if (count of whole_str)=0 then return 0
> 	if (count of find_str)=0 then return 0
> 	set tid to Applescript's text item delimiters
> 	set Applescript's text item delimiters to {find_str}
> 	set lst to text items of whole_str
> 	set Applescript's text item delimiters to tid
> 	if (count of lst)=1 then
> 		return 0
> 	else
> 		return (count of (item 1 of lst)+1)
> 	end if
> end stroffset
> I'd appreciate any postings of other fixes as it's a tiresome business to track down Applescript errors that occur only in the Macro Menu. A couple of scripts I just fixed are available at
> http://math.ucsd.edu/~msharpe/fontset.dmg
> They may be useful to those who have large collections of fonts and wish to be able to switch a saved set of fonts quickly. (To install, select Macros/Macro Editor, then select Macros/Add Macros from file, selecting each .plist from the dmg as the target.)
> Michael
> ----------- Please Consult the Following Before Posting -----------
> TeX FAQ: http://www.tex.ac.uk/faq
> List Reminders and Etiquette: http://email.esm.psu.edu/mac-tex/
> List Archive: http://tug.org/pipermail/macostex-archives/
> TeX on Mac OS X Website: http://mactex-wiki.tug.org/
> List Info: http://email.esm.psu.edu/mailman/listinfo/macosx-tex

More information about the macostex-archives mailing list