Script to get cells from sheets to comments in records

Hi all,
I want to take fields that I have in sheets (imported as CSV from excel file) and copy them to the comment of files with the same name as in the next column over in the sheet. So say the first column is the filename and the second is what i want as the comment, so i have to grab the comment, and then go to the record with the filename that is in the first column, and the paste in the comment.

My guess is it is pretty simple, and I don’t mind struggling a bit to learn what I am doing. HOwever, I can’t figure out how to go to a specifically named record in the database once i get the name and comment from the sheet.

any thoughts or suggestions?



You might try something like this:

-- variable theFilename has to contain the filename
set theRecord to content named theFilename of current database

-- variable theComment has to contain the comment
set comment of theRecord to theComment