I’m thinking that I’m going to have to learn a different scripting language since it appears that Apple has broken Finder in version 10.6. But before I go there, maybe one of you out there will have a suggestion I can use to salvage this script.
We get in anywhere between 200 - 500 images a day from our photo studio. All of these images come in named with a three digit department number, followed by and alpha code, then the actual file name. This script looks at those first three digits (the department number) and counts all of the images that belong to a certain department so that we can track which areas have the heaviest workload. In 10.5, this script ran in one to three minutes depending on the number of images) accessing a folder on our server (smb://). The script in 10.6 fails most of the time and when it does work, takes upwards around 20 minutes to run start to finish. I tried copying this image folder to my local disk and running the script on it… still took over 6 minutes. We still have access to 10.5, so it’s not the end of the world… but we will be getting upgraded eventually so I would like to cut this one off at the pass.
Here is the code:
--Department lists broken out by division numbers
current date
set AccList to {"031", "032", "033", "035", "122", "131", "132", "134", "135", "222", "234", "235", "322", "331", "422"}
set DomList to {"011", "015", "064", "075", "111", "115", "164", "175", "211", "215", "264", "311", "315", "364", "411", "464", "511", "946", "949"}
set HomeList to {"020", "023", "024", "026", "061", "065", "121", "126", "161", "165", "223", "830", "832"}
set HouseList to {"025", "060", "063", "066", "067", "125", "266", "566"}
set IntList to {"034", "036", "094", "104", "133", "143", "228", "229", "230", "231", "233", "333", "433", "443", "533", "743"}
set JewelList to {"027", "029", "127", "129", "227", "327", "427", "527", "727", "827"}
set JrList to {"044", "084", "144", "242", "244", "344", "404", "405", "406", "444", "544", "644", "744"}
set KidList to {"012", "045", "046", "047", "048", "049", "073", "074", "076", "096", "097", "112", "145", "147", "197", "245", "246", "247", "248", "272", "346", "348", "448", "920", "922"}
set MenList to {"051", "052", "053", "056", "151", "152", "153", "156", "251", "252", "253", "254", "255", "256", "352", "353", "356", "452", "453", "456", "553", "552", "556", "656"}
set MissList to {"113", "213", "413", "513", "543", "571", "913"}
set MissPlusList to {"013", "014", "016", "019", "114", "171", "214", "243", "313", "314", "342", "343", "345", "412", "414", "442", "514", "614", "643", "713", "943"}
set MissUpdatedList to {"040", "041", "043", "071", "095", "212", "324", "371", "424", "471", "524", "613", "624", "836"}
set ShoeList to {"037", "039", "137", "139", "218", "239", "287", "318", "418"}
set YoungList to {"017", "055", "057", "058", "059", "089", "117", "146", "155", "157", "159", "172", "217", "257", "355", "357", "457"}
set Miscellaneouslist to {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"}
--Count Script
set acc to 0
set dom to 0
set homedec to 0
set house to 0
set int to 0
set jewel to 0
set jr to 0
set kid to 0
set men to 0
set miss to 0
set missplus to 0
set missup to 0
set shoe to 0
set young to 0
set misc to 0
set InBox to alias "Scene7:Done:Inbox Archive:082710"
tell application "Finder"
repeat with i in AccList
set acc to acc + (count (files in InBox where name begins with i))
end repeat
repeat with i in DomList
set dom to dom + (count (files in InBox where name begins with i))
end repeat
repeat with i in HomeList
set homedec to homedec + (count (files in InBox where name begins with i))
end repeat
repeat with i in HouseList
set house to house + (count (files in InBox where name begins with i))
end repeat
repeat with i in IntList
set int to int + (count (files in InBox where name begins with i))
end repeat
repeat with i in JewelList
set jewel to jewel + (count (files in InBox where name begins with i))
end repeat
repeat with i in JrList
set jr to jr + (count (files in InBox where name begins with i))
end repeat
repeat with i in KidList
set kid to kid + (count (files in InBox where name begins with i))
end repeat
repeat with i in MenList
set men to men + (count (files in InBox where name begins with i))
end repeat
repeat with i in MissList
set miss to miss + (count (files in InBox where name begins with i))
end repeat
repeat with i in MissPlusList
set missplus to missplus + (count (files in InBox where name begins with i))
end repeat
repeat with i in MissUpdatedList
set missup to missup + (count (files in InBox where name begins with i))
end repeat
repeat with i in ShoeList
set shoe to shoe + (count (files in InBox where name begins with i))
end repeat
repeat with i in YoungList
set young to young + (count (files in InBox where name begins with i))
end repeat
repeat with i in Miscellaneouslist
set misc to misc + (count (files in InBox where name begins with i))
end repeat
--Image Total
set ImageTotal to (acc + dom + homedec + house + int + jewel + jr + kid + men + miss + missplus + missup + shoe + young + misc)
--Breakdown by department
(set the clipboard to "" & ImageTotal & " image(s) total
Accessories: " & acc & "
Domestics: " & dom & "
Home Decor: " & homedec & "
Housewares: " & house & "
Intimates: " & int & "
Jewelry: " & jewel & "
Juniors: " & jr & "
Kids: " & kid & "
Mens: " & men & "
Misses: " & miss & "
Misses Special Sizes: " & missplus & "
Misses Updated: " & missup & "
Shoes: " & shoe & "
Young Mens: " & young & "
Miscellaneous: " & misc & "")
end tell
Any suggestions would be greatly appreciated.