At 16:56 +0200 2003.04.05, Martin Buchmann wrote: >I have a bundle of MacPerl scripts using MacPerl::DoAppleScript to >include Applescript for launching other apps, etc. I know that this >is slow but i never was able to use AppleEvents directly so i'm fine >with it. > >Now i thought maybe a compilation via compile_applescript would lead >to some decrease of processing time. So i tried a simple thing like: > >use Mac::OSA::simple;
That should be a capital 'S' in 'Simple'. It may not matter in some cases in MacPerl, but it will matter in other cases, and it matters on Mac OS X (should you use your script there some day). >my $mp = compile_applescript(<<'EOMP') or die $!; As noted, this should be double quotes. >Of course all this does not lead to a big decrease in processing >time. So the final goal would be to compile a script which reads two >arguments when it is executed, in this case the filename and the >path. And then execute it several times at runtime with different >files. Is this possible? I don't know how, but probably. I am not sure how to pass arguments to a compiled AppleScript. If someone can tell me how to pass arguments to a compiled AppleScript, I can probably tell how to do this. You might also want to use Mac::Glue and Mac::Apps::Launch. #!perl -w use Mac::Glue; my $mpost = Mac::Glue->new('mpost'); $mpost->exec($command, ...); I am not sure what mpost's AppleScript dictionary looks like. Just follow the instructions for Mac::Glue (it comes with MacPerl 5.6.1) for running gluedialect and gluescriptadds, and then drop apps on gluemac (like the Finder and mpost). If you have trouble figuring out the syntax, send me the mpost.pod file that gluemac generates and I might be able to help out. -- Chris Nandor [EMAIL PROTECTED] http://pudge.net/ Open Source Development Network [EMAIL PROTECTED] http://osdn.com/