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

[MacPerl] calling Perl script from applescript




Hi, I'm writing a program that combines an applecscript interacting with
Quark with a PERL script that processes text files.  How do I call the 
PERL perl script from within my applescript so that I can pass individual
files via @ARGV.  The applescript is a droplet that takes whatever folder
it is fed and converts the Quark docs inside into TXT files.  Ideally, I'd
like for the PERL script to begin iterating through the directory once the
Quark manipulations are done.  I tried something (probably oversimplistic)
that looks like this:


tell application "Finder"
  tell folder sourcefiles
      set theTextDocs to (every file of entire contents of sourcefiles
       whose kind is not "alias" and the file type is "TXT")
	--in case there is only one item in the folder, coerce to list
	 if the class of theTextDocs is not list then set theTextDocs to
           {theTextDocs}
		-- now iterate through the individual files
		repeat with theItem in theTextDocs
		 set Tdoc to theItem as text
	           tell application "MacPerl"
		     @ARGV = (Tdoc)
		     Do Script "&MacPerl'Converter(join(\",\",stat(\"MacPerl\")))"
		   end tell
		end repeat
	end tell
end tell

It would probably be faster if the PERL script iterated through the folder
on its own instead of relying on appleEvents to feed it new files every
time, but I'm just beginning here so I don't know what the hell I'm doing.
Anybody have any ideas?  Any help would be really appreciated.  Thanks,

							-Scott


   Scott Gross
   Columbia University CC '98
   8C1 Wallach Hall     
   New York, NY 10027  
   _________________________________________________________________________
                                                     (212) 853-6680
                                                     sbg23@columbia.edu
                                                     www.columbia.edu/~sbg23
                                                     PAGER: 1-888-946-2386 or
                                                     sbg23-pager@columbia.edu


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