Batch rename of files using AppleScript

I have a load of videos that I’ve made. I have them all sorted by order but I’d like to tag on episode names at the end of them. Is there anyway to take a list and add it on to the end of a file? For example, my files are named s01e01, s01e02, etc. My list is as follows Pilot, New Beginnings, etc. Each new list item is on a new line.

Hope that makes sense.

Hi,

something like this

set titleList to paragraphs of (read (choose file with prompt "Choose file which contains the title list" without invisibles))
set theFolder to choose folder

tell application "Finder" to set these_files to files of theFolder
repeat with i from 1 to count these_files
	set {name:Nm, name extension:Ex} to info for (item i of these_files) as alias
	if Ex is missing value then set Ex to ""
	if Ex is not "" then
		set Nm to text 1 thru ((count Nm) - (count Ex) - 1) of Nm
		set Ex to "." & Ex
	end if
	tell application "Finder" to set name of item i of these_files to Nm & "_" & item i of titleList & Ex
end repeat

note: there is no error handling, if the number of files and the number of paragraphs are not equal

Wow that’s great! Thanks StefanK!