How Mark Images in a Directory using Apple Scripts


HI, Im found this apple script from a number of years ago and would like to develop it further. But am not sure how.

1) would like it to pop up and ask for name_list, instead of hard coding the image filename CMP_1750.jpg......
2) would like for it to request the directory to search not the currently active folder.
3) fix the script so that it does not take forever and a year to finish ( there is a bug I think)

the script should search for the name_list filenames in a selected directory and mark them all with an orange dot.
then pop up a dialog box to let the user know it is finished.

Any help would be appreciated!!!

set name_list to "CMP_1750.jpg
CMP_1780.jpg" --just paste the whole text file into these quotes
set AppleScript's text item delimiters to ASCII character 10
if the number of text items of name_list < 2 then set AppleScript's text item delimiters to ASCII character 13 --depending on the alignment of the stars, the text above might be formatted differently but look exactly the same.
set name_list to every text item of name_list
tell application "Finder"
set the_folder to the folder of window 1 --the currently active folder in the Finder
repeat with n in name_list
set (the label index of every item of the_folder whose name begins with n) to 1 --label matches orange
end try
end repeat