I’m trying to get the number of files in a folder that have the same name. I’m using the following script which works for a folder on my desktop. But when I try a different folder I get the message “Can’t Find Folder”. I’ve tried different delimiters, I’ve tried different folders and I always get the same error message. I’m certain this is something simple I’m just missing.
property baseFileName : "EndiveName" set targetDir to "/Applications/Endive Clients/" tell application "Finder" set fileCount to count of (files in folder targetDir whose name contains baseFileName) end tell