Locate files in finder from excel spreadsheet and mark with exiftool

Goal:
Locate files in finder from excel spreadsheet and mark with exiftool. In the spreadsheet: Column 1 = filenames and Column 2 = keep/delete.

Issue:
I dont understand how to include a variable in the spotlight query. Getting messed up by the single quotes and backslash escapes.

I’ll deal with the looping and exiftool (which i do understand) after I’ve nailed this down. Right?

Limited Progress:


tell application "Microsoft Excel"
	set excelvariable to value of cell "A10"
end tell
set folderx to quoted form of POSIX path of (choose folder)
set spotlightquery to "kMDItemFSName =" & excelvariable
set command to "mdfind -onlyin " & folderx & " " & spotlightquery
set founditems to paragraphs of (do shell script command)

Thank you.
Matt

Model: iMac 3.2gHz
AppleScript: 2.1.2
Browser: Firefox 3.6.13
Operating System: Mac OS X (10.6)

This was difficult but I worked it out for one of my scripts in the past, so here’s that code. Hope it helps!

set excelVariable to "china"

set folderx to choose folder
set foundFiles to paragraphs of (do shell script ("mdfind -onlyin " & quoted form of POSIX path of folderx & " 'kMDItemFSName == \"" & excelVariable & "\"wc'"))