I am fairly new to applescript and am struggling with this one!
I need to be able to count the number of files in a folder which have same last two characters in their file name.
Files names look like this V0012345-LH-LS so in this case I would like to count the files ending with LS. HELP!
Something like this might work and I hope it turns that frown upside down.
set targFol to choose folder
set endCharacters to "ls"
tell application "Finder"
set myList to every file of folder targFol whose name ends with endCharacters
end tell
set itemCount to count of myList
display dialog (itemCount as text) & " files found which end with " & """ & endCharacters & """
Some of this code is for demo purposes only and can be removed. Please feel free to ask for clarification if you need more customized code.