[Mac OS X TeX] Towards Alpha/Classic-MacOS X integration.

Jon Guyer jguyer at his.com
Mon Sep 10 10:50:22 EDT 2001



<x-flowed>At 6:31 AM +0200 9/10/01, iso-8859-15?Q?Philippe_Lel=E9dy wrote:

>Remark: there are several free Scripting addition that adds to Apple
>Scripting Language some primitives like "shell" to trigger an Unix Script,
>with arguments, but I don't know how Alpha can trigger AppleScript. I
>tried the Alpha Command "dosc" w/o success.

I suspect you did something like this (to use a trivial example)

	dosc -n Finder -s "get disks"

expecting the AppleScript "get disks" to be directed at the Finder. 
Unfortunately, that's not what [dosc] does (and no, it's not clearly 
documented).

By default, [dosc] sends the string supplied with '-s' to the 
specified app as an argument to that app's misc/dosc (DoScript) 
AppleEvent handler. This is useful for communicating with 
applications that are based on some non-AppleScript scripting 
language (like Alpha itself is). The Finder doesn't have a DoScript 
command, so this doesn't work. Your desire to send shell commands is 
actually a perfect application of [dosc], but only if the shell (or 
some intermediary) supports the misc/dosc AppleEvent. If you can 
figure out what AppleEvent is generated when the "shell" AS is 
invoked (see below), you could still use [dosc] with the -k and -e 
flags.

You may need (or want) to send raw AppleEvents, using either 
[AEBuild] or [tclAE::send]. I recommend the latter, but then I wrote 
it. In order to determine what arguments to supply, you'll need to 
cheat by eavesdropping on Script Editor while it sends the message 
you want. I give some instructions for doing all of this at

<http://www.his.com/jguyer/Alpha/TclAE%20Help/tclAEcheaters.html>


The yet-to-be-released Alpha 8 allows you to use the Tclapplescript 
package, which would enable you to do what you want, but until then, 
TclAE is the way to go. Also, Alpha 8 on Mac OS X uses the supplied 
eunuchs version of the Tcl library, so you should be able there to 
use [exec] to issue your shell commands directly, although I haven't 
tried (/much/ bigger fish to fry in AlphaX). Neither of these will 
work with Alpha 7 in Classic, though.


Please contact me directly if you need help with implementing this.

-- 

   Jonathan E. Guyer
   <http://www.his.com/jguyer/>

-----------------------------------------------------------------
To UNSUBSCRIBE, send email to <info at email.esm.psu.edu> with
"unsubscribe macosx-tex" (no quotes) in the body.
For additional HELP, send email to <info at email.esm.psu.edu> with
"help" (no quotes) in the body.
This list is not moderated, and I am not responsible for
messages posted by third parties.
-----------------------------------------------------------------
</x-flowed>




More information about the MacOSX-TeX mailing list