[OS X TeX] Adding a macro to TeXShop via an installer script

Alan Munn amunn at gmx.com
Sat Jan 30 22:21:20 CET 2010


On Jan 30, 2010, at 2:01 PM, Peter Dyballa wrote:

>
> Am 30.01.2010 um 18:56 schrieb Alan Munn:
>
>> Second, is is possible to add plist items via a script?
>
>
> Of course! There is the defaults programme. For non-preferences  
> files you need to give it the whole pathname but leave away the  
> extension, for example:
>
> 	defaults read ~/Library/TeXShop/Latex_Macros
>
> And the same way you can write to it, delete settings from it...

On Jan 30, 2010, at 1:06 PM, Adam R. Maxwell wrote:

> It's possible, but using a shell script with typical tools (sed/awk)  
> has a lot of potential to corrupt the file (especially if it's a  
> binary plist!). I'd use python and plistlib or PyObjC to do it…which  
> still might not work if TeXShop had the file open for some reason.

Thanks Pete and Adam.  Your worries, Adam were exactly what I had in  
mind.

But Dick thinks it's a good idea to add the script to the TeXShop  
distribution, so that's what we'll do, and I'll avoid the whole  
issue.  The script will still be available on CTAN for anyone who  
wants to use it with other editors.

Thanks

Alan


-- 
Alan Munn
amunn at gmx.com




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/macostex-archives/attachments/20100130/1ec56e11/attachment.html>


More information about the macostex-archives mailing list