AppleScript and Squeak

Anthony Adachi adachipro at yahoo.com
Thu May 1 20:58:37 UTC 2003


On Thu, 1 May 2003, Aaron J Reichow wrote:

>  On Thu, 1 May 2003, Anthony Adachi wrote:
>  
>  > In addition, I'm wondering in what capacity is it
>  > possible to communicate with AppleScripts which
exist
>  > outside of the Squeak image?
>  
>  In what way?

In various aspects, actually. The work that I've done
to this point has mainly been in AppleScript so I'm
just curious as to the range of possibilities in
AppleScript's interactions with Squeak. For instance,
(with either the AppleScript classes in the standard
image or from a third party) can one get back an
AppleScript object which can be stored or manipulated
within Squeak? Like a reference, number, record,
script object (with it's properties intact) ect.? Or
is is one limited to only getting back strings?

>  With the Applescript class in Squeak, you basically
get
>  one
>  core action: Applescript>>#doIt:, which evaluates
an
>  AppleScript string.
>  You pass the doIt: method regular AppleScript code-
>  it's not like using an
>  AppleEvents package with Perl, TCL, etc... You can
use
>  it for anything
>  you'd have other AS scripts for, including calling
>  other AppleScripts.
>  
>  The idea is that you evalate Applescript doIt:
>  'somecode goes here' and
>  what is returned from AppleScript is returned to
you in
>  a string. If you
>  ask it what 4+4 is, you get a string with '8'; if
you
>  ask it what the
>  names of the Safari windows are, you get an
>  AppleScript-formatted literal
>  array containing the window titles. You can then
parse
>  this string or do
>  whatever you need to do to get at the info.

So, I assume one is limited to just getting strings?
Then, if needed, one must extract and translate that
data into the appropriate Smalltalk object e.g.- '8'
to 8 or '{"hello", 7, }' to  #('hello' 7 ). 

>  I don't think there is anyway currently to have
>  AppleScript call into
>  Squeak as-is. *However,* using the XML-RPC or SOAP
>  stuff that comes with
>  the OS X version of AppleScript and XML-RPC or SOAP
>  classes easily
>  installed through SqueakMap, you could write a
>  framework for scripting
>  apps that is callable through XML-RPC or SOAP. If
your
>  application
>  already had the ability to be scripted through
another
>  means, adding
>  XML-RPC or SOAP would be pretty easy to do, a
fairly
>  simple wrap job
>  provided your app scripting API didn't need to
return
>  complex squeak
>  objects.

I'm using Mac OS 9.1 so I don't have those XML-RPC or
SOAP components.

Thanks,

Anthony


__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com



More information about the Squeak-dev mailing list