Re: Source Text of Script Objects
Re: Source Text of Script Objects
- Subject: Re: Source Text of Script Objects
- From: has <email@hidden>
- Date: Sun, 30 Dec 2001 20:20:59 +0000
Paul Berkowitz wrote:
>
>> Does anyone know how to get the source text of a script object - in
>
>> applescript?
>
>
>
> Jon's Commands has a built-in coercion. Alternatively you could script
>
> something like Smile to get it. I'm not aware of any vanilla method,
>
> unfortunately.
>
>
Thanks, has. Unfortunately, Jon's won't work in OS X, where I am most of the
>
time (until Jon himself will, we're stuck). But yes, the Satimage osax,
>
available in OS X complete with its four 'resource' commands, appears to be
>
alive and well. I have never attempted anything with these resource
>
commands, however, and don't really know where to start. Does the source
>
text of a script have a particular resource number?
Well, the problem with getting a script file's scpt resource is that the
contents have already been compiled, so there's probably not a lot you can
do with it.
What you can do is tell Smile (which is scriptable up to its armpits) to
open the file for you and then get the contents of window 1. That'll give
you what you're after. BTW, for OS X, you'll want to get Smile 2.x.x (for
classic MacOS, use Smile 1.x.x).
HTH
has