I can't get AppleScript to run

Andrew C. Greenberg werdna at mucow.com
Sat Aug 12 20:07:50 UTC 2000


At 3:21 PM -0400 8/12/00, David N. Smith \(IBM wrote:
>Well, I'm probably missing something obvious, but I can't get 
>Applescript scripts to run. I've tried several of the examples, 
>including beep. I'm running almost the latest 2.8 Beta in 50 Meg. I 
>have the plug-in TestOSAPlugin  from 9/27/99. I run on a G3 
>PowerBook with System 9.0.4. Here is what happens.
>
>(1) My example, that runs nicely from the editor or as an applet:
>
>Applescript doIt: '
>tell application "Finder"
>	activate
>	select file "Solitaire  Dave" of folder "Rec" of folder 
>"popups" of startup disk
>	open selection
>end tell'
>
>In Squeak, it usually answers 'Out of memory'. Once It got a walk 
>back with some message about Unable to Release Unallocated Memory, 
>or something like that.
>
>
>(2) Applescript doIt: 'beep 3'
>
>I run this directly from the class comment in class  Applescript. 
>This gets ' A number can't go after this identifier.'
>
>(3) Applescript doIt: 'beep'

Hmmm... All three examples worked for me (the first gave me the 
obvious meaningful error message because the files didn't exist -- I 
didn't try modifying the script, but other, similar scripts have 
worked for me) running 2.9alpha with the most recent VM Build.  It 
also ran running 2.8, 2.8alpha and 2.7, using the same VM (I think). 
I am also running MacOS 9.0.4.

It is possible that the 9/27/99 plugin isn't happy with the VM you 
are running?  What version VM are you using?  Perhaps upgrading the 
VM will help?

You might have some memory issues, despite (or perhaps because) of 
the allocation of 50M to Squeak.  On MacOS, calling plugins sometimes 
requires use of non-object application memory, and the minimum slosh 
allocated by the VM may not be sufficient.  This can be increased by 
using,

	Smalltalk extraVMMemory: numberBytesInAdditionToSlosh

saving the image and restarting the machine, careful to assure there 
is enough space for the application memory as well as the object 
memory space in the Finder allocation.

Given the nature of the beep scripts, however, this is unlikely to be 
the cause of your problem unless you are using another memory-hogging 
plugin.  Calling Applescript *WILL* make use of system heap space as 
well, as will the selection of the Solitaire program.  If you pump up 
the memory allocated to Squeak too high, there may well be no memory 
left for the Applescript and its application code to run.  Perhaps 
reducing the allocation to Squeak will improve things?

The behavior in (2) is, however, bizarre.
-- 
Andrew C. Greenberg		acg at netwolves.com
V.P. Eng., R&D, 		813.885.2779 (office)
NetWolves Corporation		813.885.2380 (facsimile)
www.netwolves.com

Please use werdna at mucow.com instead of werdna at gate.net





More information about the Squeak-dev mailing list