AppleScript via a Perl Script

Hello all -

How might I go about sending a list of files in a specified folder through a Perl script I have ready to receive them (I’ve verified that it works when I load the files manually)?

Basically, I’ve got a folder of various files. Among them are any number of html files that I need to run through my Perl script (the Perl script will then move them into a new folder, which it creates). Here’s what I’ve got… go easy, this is only my second attempt at any AppleScripting, and I’m mostly reworking one that came preinstalled on the machine as a foundation… :wink:

tell application “Finder” to set the source_folder to (folder of the front window) as alias
on error – no open folder windows
display dialog “Sorry, uh, what folder did you need?”
end try
set the item_list to (list all items whose name extension is “html” of list folder source_folder)
set source_folder to source_folder as string
repeat with i from 1 to number of items in the item_list
set this_item to item i of the item_list
set this_item to (source_folder & this_item) as alias
do shell script "/bin/tcsh ~/path/to/ " & (path to this_item as POSIX path)
end repeat

After I get all of that all working, I need to send the rest of the files in the folder over to the newly created one as well… Doesn’t strike me as too difficult.

If it makes a difference, I’m running 10.3.3, and all the folders & paths will be the same everytime, not variable.

Much thanks in advance!

  • kid A