--On Tuesday, November 25, 2003 10:59 AM +0100 Martin Buchmann <[EMAIL PROTECTED]> wrote:

Joshua, John and Chris,

sorry for all that mess. I think it's harder to make clear what i'm
talking about than i thought in the beginning.

'test' is the name of the MacPerl droplet. "Hallo" was just something i
tried to pass to the droplet. In a real case it would have been a
filename, etc.

I suggest we stick to real-world examples. We'll have a much easier time helping you do what you want to do if we know what that is, and can make sense of it.


In my test tex file i just have something like this:

\write18{test "Hallo"}

That's what i called "the call" before. Normally pdftex processes TeX
source and generates a pdf from that. The write18 command enables you to
access shell escapes with unixish systems, i.e. the argument of the
command is passed to the shell. Now this is also working with MacOS 9.2.2
even without a shell. I don't know how exactely but it must have
something to do with AppleEvents i guessed.

Actually, the text in braces is not passed directly to a shell, but must be interpreted further by the tool, to deal with #2 and all that, which I assume refer to file descriptors or the like. And the documentation I read warns not to use shell I/O redirection. So the tex interpreter is doing the shell's job here.


Anyway, the write18 invocation results in an Apple event sent, of class 'CMTX' and ID 'exec'. The direct object parameter is a unix-like command line, and the additional parameter 'dest' specifies the current working directory. A reply with a result code (0 for success) is expected.

If you just want to something to *happen*, then all you need is the right glue -- something to receive the CMTX/exec event and call your Perl code. However, if you actually want to get *output* from your script, you need to know the mechanism pdftex uses to do this -- assuming there is one.

If you need output and there's no way to do it through Apple events, then you may be able to do it within MPW, though my understanding is that MPW tools can't call other tools. I wrote my own command shell environment (Genie/LAMP) to work around that. Using Genie would involve porting pdftex more directly, using POSIX calls for the shell escape instead of sending an Apple event. That may be a overkill for what you're trying to do, but it would work. I can't just pop that off in my spare time, though; contact me off-list if you're interested.

Josh

--
Joshua Juran
Metamage Software Creations - Mac Software and Consulting
http://www.metamage.com/

* Creation at the highest state of the art *




Reply via email to