On Dec 1, 2008, at 3:30 PM, Steffen Mueller wrote:

Hi Wade,

H. Wade Minter wrote:
I've got a fairly complex Perl/Tk application that I'm rebuilding with
PAR on a Mac for the first time in ages.  I'm having a problem with
Mac::AppleScript that I can't figure out.
               RunAppleScript(
qq(tell application "System Events" to (creator type
of processes) contains "Audn")
               ) eq "true"
[...]

If I run the script straight from the command line, it works fine.
However, if I do a "pp -o mrvoice mrvoice.pl" and then run the resulting
"mrvoice" file, it bombs out with an AppleScript error "-1753", which
appears to be a "Script Error".

Any ideas what might be causing this AppleScript problem when running
under PAR?

Unfortunately, no. I can't even test it as I don't have access to a Mac.
I would also think that this should work. It's an XS module, but its
source looks innocent enough. It doesn't have any fancy, somehow
implicit, dependencies either... Here's some steps you could take to
debug this:

- Create a very simple test script that just runs one little piece of
apple script.
- Try to simply package that with pp.

To be honest, I'm not even quite sure where to go from there. I suppose
the simple test script also fails. Here are some more ideas:

- Can you somehow monitor any calls to external shared libraries?
- You can get at the contents of the execuatble by simply unzipping it.

I know, not much help. I'm sorry.

Sure, here's a small testcase.

####

#!/usr/bin/perl

use Mac::AppleScript qw(RunAppleScript);
if (RunAppleScript(qq(tell application "Safari"\nactivate\nend tell)) )
{
  print "Success!\n";
}
else
{
  die "Didn't work! Error code: $@";
}


####

And here's the output:

minter:~$ ./mactest.pl
Success!
minter:~$ pp -o mactest mactest.pl
minter:~$ ./mactest
Didn't work! Error code: -1753 at script/mactest.pl line 11.



Reply via email to