> 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. > > Part of the task is to locate some applications/Xtensions, and get there > version numbers and modification dates. I felt that File::Find would be > the easiest way to locate the files (An applescript search takes forever), > and I could get the other information through Applescript using the Finder > (OS 9.2.2, Perl 5.6.1r2). This is the first time I'm using the Find > module. I could use a little help, advice, et. al. > > Below is the Applescript that I'm using to test. The file names I'm > looking for are "Pearson Translator", "XMLxt(tm) 3.9 PPC 4.x", and > "AutopageŽ XT 5.6 PPC4.x". I'm assuming that these files are anywhere on > the startup volume. Right now, I'm getting an empty dialog box. Help! > > 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-- > #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); > # I'm trying to get the files only if they are in the XTension folder of > Quark. > }elsif(($_ =~m/XMLxt.*?/)||($_ =~ > m/Autopage.*?/)&&($File::Find::dir=~m/.*?:XTension:$/)){ > push (@paths, $File::Find::name); > } > return @paths; > } > > " > end timeout > display dialog (PathString as Text) buttons {"Button1"} default > button 1 > > end tell > > > **************************************************************************** This email may contain confidential material. If you were not an intended recipient, please notify the sender and delete all copies. We may monitor email to and from our network.
****************************************************************************