[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] MacPerl, Mac OS 8, and AppleScript



Is MacPerl 5.2.0r4 compatible with Mac OS 8.1 and 8.5.1?
I have a very simple script that crashes a Mac running
each of them. All it does is run an application (which
happens to be an earlier version of MacPerl with a script
built in) and get it to read commands from a file and quit.
The application has been working for years. Running
the AppleScript from the Script Editor worked all afternoon
yesterday, and worked *once* from Perl. It seems to damage
memory (or something) in some way that doesn't cause an
immediate crash. When I run the script the second time,
it crashes almost at once. This is the MPW tool version of
Perl 5.2.0r4, with MPW Shell 3.5d6, running on Mac OS 8.1 and
8.5.1 (most of the testing was done on 8.5.1).

The Perl script is:

	$script = <<EOS;
	with timeout of 36000 seconds
		tell application "foo:bar:baz"
			launch
			Open file "wibble:wobble"
		end tell
	end timeout
	EOS

	&MacPerl::DoAppleScript($script);

It uses "launch" so that the app will act on the contents
of the file that it opens, instead of opening it up in a
MacPerl editing window as it would if run interactively.
I could tell the Finder to open the file using the app,
but then my script wouldn't wait until the app had finished.
The production version will have more to do after that.

The stack trace goes:
(..unnamed functions...)
__start+00154
main+000E0
perl_run+002CC
Perl_runops+00068
Perl_pp_entersub+00608
XS_MacPerl_DoAppleScript+00118
OSADoScript+007C
PowerPCCallComponent+000D0
(...unnamed functions...)
AESend+00040
'PACK 0008 0002 AevtMgr' + 0516E
'PACK 0008 0002 AevtMgr' + 04CE8
'PACK 0008 0002 AevtMgr' + 0470E
EmToNatEndMoveParams+00014
(unnamed)
AEGetParamPtr+00040
'PACK 0008 0002 AevtMgr' + 024A8
'PACK 0008 0002 AevtMgr' + 0393E
'PACK 0008 0002 AevtMgr' + 0690C
'PACK 0008 0002 AevtMgr' + 0683C

I tried simplifying the script: $script = 'display dialog "foo"'
didn't do anything. From the Script Editor, it displayed the dialog.

Sorry to be such a pain with my first message to the list ...

Peter.


"You should be glad that bridge fell down. I was planning to build
thirteen more to the same design." - Isambard Kingdom Brunel

***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch