At 12:38 PM -0500 12/24/02, Nestor, John wrote:
> Hi,
Hi.
>I have this task in which I'm mixing/matching Applescript and MacPerl to take advantage of each language's strength at the appropriate time.
That sounds reasonable. <snip>
> tell application "MacPerl"activate
with timeout of 6000 seconds
set PathString to Do Script "
#!perl -w
use File::Find;
# I should wind up with an array of full paths, right? @files=find(\\&wanted, 'Macintosh HD:');
# I'm playing is safe and returning a string--
Then why not create a string in the first place?
# '.' is the string concatenation operator. '.=' is like '+=', but with string concatenation.> #I know I can pass strings back and forth--hey, I'm a beginner, remember?:)
$files=join(\",\",@files);
MacPerl::Reply($files);
sub wanted {
if ($_ =~ m/Pearson Translator/){
> push (@paths, $File::Find::name);
$returnString .= "$File::Find::name,";
Are you sure that you're supposed to return an array from the wanted function? Are you sure returning "@paths" will actually return the array, and not something else? Maybe you should return a reference to the array?> }return @paths;
You might have better luck getting the perl script to work from within MacPerl and then trying to test calling it from AppleScript. That way you know where the problem is.> }" end timeout display dialog (PathString as Text) buttons {"Button1"} default button 1> end tell
I suspect that you aren't returning the right thing from your wanted function. If you read the perldoc for File::Find in Shuck, it should help. And since you're looking to return a string to AppleScript anyway, it's probably easier to create one in the first place rather than do something fancy with an array.
-Jeff Lowrey