metadata keywords
I use Bridge to append Metadata to the Keywords field. I would like the script below to get a a total file count of the PDFs containing ONLY the keyword "correction" on selected folders & output that info to a text file.
I'm having difficulties with mdfind & mdls. I have no knowledge on Terminal commands. Let's say I have a 4 folders with 200 pdfs each some of them have the keyword "correction" I want the final result on the text file be:
folder 1 CORRECTS= 50
folder 2 CORRECTS= 58
folder 3 CORRECTS= 115
folder 4 CORRECTS= 35
I'm just need the correct syntax code to make this work
set target_folder to choose folderwith prompt "Choose target folders" with multiple selections allowed without invisibles
set results to ""
repeat with i from 1 to (count target_folder)
set thisFolder to (POSIX path of itemi of target_folder)
--->>>> THIS iS THE PART I NEED HELP WITH -----<<<<
set fileCount to paragraphs of (do shell script "mdfind ' kMDItemKeywords == correction' -count") & quoted form of thisFolder
¬--& " -type f -iname *.pdf | wc -l"
set results to (results & "" & tab & "CORRECTS=" & tab & fileCount & return)
--->>>> THIS iS THE PART I NEED HELP WITH -----<<<<
end repeat
set theFilePath to (path to desktop folder as string) & "PDF correction count.txt"
set theFile to open for accessfiletheFilePath with write permission
try
set eof of theFileto 0
--write results to file theFilePath
writeresultstotheFile
close accesstheFile
on error
close accesstheFile
end try
iMac, Mac OS X (10.6.8)