On 7/17/2014 2:19 AM, Thomas Floeren wrote:
Hello,

Some months ago I wrote a little AppleScript script with one purpose: It should 
be a flexible script to launch ConTeXt typesetting, independently of the text 
editor I’m using and it should be capable to typeset the Product file even if 
I’m currently editing any component file belonging to that Product file.

I used it for some time, I improved it, and I shared it with a collegue who 
also works with ConText on OSX. We’re still using it, many bugs have been fixed 
and some features were added.

The script proved to be very useful for us and I thought, why not share it with 
the other Mac-ConTeXt people?


So here it is:

https://www.wuala.com/tflo/Scripts/Ctx%20Typeset/?key=75QkpizhdpFS


As already said, the main purpose of the script is to launch the Ctx 
typesetting process (short: Ctx) on a file.

Regarding the “a file” the script is very configurable and flexible:

A) It can launch Ctx on a file currently opened in your text editor. It works 
with many text editors (BBEdit, MacVim, TextMate, etc.) as long as the editor 
is the frontmost process.

B) It can launch Ctx on the parent Product file of the component file currently 
being edited. Defining a “Product file” can either be done semi-automatically 
or by hard-definition with two swappable register slots.

C) If no eligible file is opend in an editor it will launch Ctx on the 
currently selected tex file in the Finder.


The options added in the course of time are:

A) Usage of a ConTeXt-Beta or a ConTeXt-Current installation, swappable
B) Typesetting in the non-interactive shell or in the visible terminal
C) Notifications
D) Selection of PDF viewer (Skim, Preview, Adobe, …)
E) Automatically calling the PDF viewer or not
F) Optionally excluding generated PDFs from TM backup
G) luatex or luajitex
H) Beeps or no beeps, and so on
I) Many other things, explained in the Description

Also some features (“Tools”) have been added:

A) Purging files including generated PDFs
B) Info on the used Ctx version
C) Updating the Ctx Minimal (Beta or/and Current) and archiving the old one
D) Syntax Check
E) Make formats, listing fonts, other, …
F) Some extras added in the Extras folder (synctex with BBEdit etc.)
G) Much more in the Description


Some caveats:

A) It works only on OS X

B) The script is designed to work with 10.9 (Mavericks). It should also work 
with 10.8 (old notification via 3rdParty is still implemented).

C) Out of the box it works only with the so called “ConTeXt Minimal 
Installation” (aka ConTeXt Standalone). It won’t work with TeXLive 
installations or any other kind of excessively screwed-up installations. But 
you can go into the script to make it work with anything.

D) In order to get access to any text editor the script makes use of GUI 
scripting: you have to liberate the rights in the corresponding OS preferences. 
This may sound risky to you but the code is open so you can assure yourself of 
what the script does.

E) You have to (and you really should!) read the Description that comes with 
the script.

If you are enjoing the script please share it here, if the script is buggy, or 
doesn’t work for you at all please let me know too, please.

A nice initiative. Can you put the description online too? So that non osx users can get the extended description too? Maybe the dmg file can be put on the garden in <texroot>/context/data/osx or so?

If you need more functionality (in e.g. mtxrun or context) to make things easier, don't hesitate to ask for it.

Hans

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
    tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to