I have an AppleScript created with a lot of copy and past from examples, that moves files to folders using a text file input.
The script creates the output folder and moves files with the following code:
-- Move and rename error files
set outFolder1 to (make new folder at adesktop with properties {name:jobName & "_errors"}) as string
set matchList to (every item in folder inFolder whose name is in errorList) as alias list
repeat with anItem in matchList
move ((inFolder & anItem's name) as text) to folder outFolder1
end repeat
I need to rename the files but the matchlist and the errorless only contain the original jpg file names. The script creates another list “printErrors” with the following:
firstName {tab} lastName {tab} grade {tab} fname {return}
I need to match the jpg files in outFolder1 with the fname field in the printErrors list and rename them as follows:
grade_firstName_lastName.jpg (with the data from those fields.
I’m lost and a novice at this – any help will be greatly appreciated