Help Needed-Script to take Column from .csv File to Comment

Hi,
i am trying to take a .csv file that I exported from Excel and use one of the columns as the “Comment” on each of the files. Basically, the .csv is the index of the files in a folder in DTPro and has a field for my reviewer comments. I would like to integrate those comments into DTPro as the comments on the files themselves rather than the index. Seems simple enough, as I just have to tick down the csv file copy each entry at that column, set it to the comment, and go down each in sequence. I am having trouble though.

Any help is appreciated.

You might have a look at the scripts in the folder ~/Library/Application Support/DEVONthink Pro/Sheets (or see menu Scripts > Sheets > …).

thanks christian,
I got the sheets part to work. Now, what is the best way to go to the record/pdf that i want to slap the comment into? Let’s say it is in a group called “Pdfs” and has a name that also can be pulled from the sheet.

is there a way to say set comment of record with name equal to " " to comment

or? i am not sure how to reference the pdf.

thanks.

There are several ways to find a record, here are two examples:


set theName to "Test"

tell application "DEVONthink Pro"
	try
		-- Throws an exception if content does not exist
		set theRecord to content named theName of current database
	end try
end tell

tell application "DEVONthink Pro"
	-- Searches only inside the specified group
	set theGroupLocation to "/PDFs/"
	set theRecord to get record at (theGroupLocation & theName)
end tell

when i try to set theRecord to content named…

DEVONthink Pro got an error: Can’t make record “testpdf.pdf” of current database of document window id 912 into type reference.

Does a content with this name really exist? Otherwise errors are the consequence.