Need to get over the hump

I copied this script (Just learning) getting this error (The variable delimiters is not defined.) in the line (set AppleScript’s text delimiters to old) can someone explain
Thanks
Jimmy
set the_folder to choose folder “select photo folder”
set the_folder_path to get_folder_path(the_folder)
tell application “Finder”
set the_files to files of folder the_folder does not contain “ex”
repeat with a_file in the_files
set new_file_name to my the_folder_path & "p " & the_name of the_file
tell application “Adobe Photoshop CS”
open file (a_file as string) showing dialogs never
set d to the current document
adjust current layer of d using color balance with options {midtones:{-10, 0, 0}, preserve luminosity:true}
do action “auto color” from “Default Actions”
filter current layer of d using unsharp mask with options {class:unsharp mask, amount:100.0, radius:2.2, threshold:1}
save d in file new_file_name as JPEG with options {quailty:7}
close current document
return
end tell
end repeat
end tell
on get_folder_path(the_folder)
set the_folder to the_folder as string
set old to AppleScript’s text item delimiters
set AppleScript’s text item delimiters to “:”
set n to the number of text items in the_folder
set the_folders to text items 1 through (n - 1) of the_folder
set the_path to " "
repeat with a_folder in the_folders
set the_path to the_path & a_folder & “:”
end repeat
set AppleScript’s text delimiters to old
return the_path
end get_folder_path

set AppleScript’s text delimiters to old

should be:

set AppleScript’s text item delimiters to old

Thanks for looking inti this[/b]