At 14:01 -0700 3/4/01, Doug McNutt wrote:

The problem with doing this using the Perl tool within the MPW environment is right 
here:

>MacPerl::DoAppleScript(<<HERE);
>    tell application "Netscape Communicator"
>        activate
>        GetURL "$theURL" to file "$tempFile"
>    end tell
>HERE

I've discovered that an MPW tool cannot initiate an AppleScript more than once. The 
problem is that the AppleScript subsystem maintains some per-process information in 
it's cache, and expects that process to stick around until an ExitToShell. Since an 
MPW tool behaves more like a plug-in, it doesn't call ExitToShell, and so AppleScript 
doesn't notice when the code fragment that called it goes away. When it's called again 
from the same Process Manager process, but a different context within that process, it 
gets horribly confused as evidenced by the crash.

I could find no solution to this problem for the MPW tool environment. My solution was 
to add a RunApplescript built-in command in the MPW Shell. That command is available 
in the latest version of the shell, 3.6d4.
-- 

Greg Branche
MPW Entomologist
Apple Computer, Inc.

Reply via email to