Updating Custom Metadata of a Document Using a Script

In the help file for updating custom metadata it says

When you create a custom metadata field, you give it a name. DEVONthink uses this name to create an identifier for use in automated processes. This identifier is created automatically and cannot be changed.

I have a custom metadata field MyComment which takes text. I would like to update via a script.
I am having problems doing it. Is this the proper way of coding it?

		set myNewComment to "Hello World"		
		add custom meta data myNewComment  for "MyComment" to theRecord

theRecord would be the currently selected document.

Thanks

This should actually work but it’s ideal to use the actual identifier, no matter whether with or without the md prefix. You can view the identifier in Preferences > Data after selecting the definition of the comment metadata.