How to inherit the Parent folder custom metadata to child items?

Hi,

I’m trying to run a Smart Rule that inherits custom metadata from the parent group to the child records.

However, DEVONthink always throws this error:

“A identifier can’t go after this property.”

i have 3 custom data that should be inherited, which is date1, teacher, curriculum (these are the identifier of the custommetadata field).

Dlayer, Vlayer tagged folders should be inheriting those metadata from its parent folder (tagged as Clayer), however it isn’t working off.

Can I get some help plz?

Are you sure that the command is set custom metadata?

Usage of location group instead of parent 1 is recommended as parents include both groups and tags and parent 1 might be a tag.

The correct syntax is set parentTeacher to get custom meta data for "teacher" from parentRecord and add custom meta data parentTeacher for "teacher" to thisRecord

A fixed and simplified script could look like this:

property pProperties : {"curriculum", "teacher", "date1"}

on performSmartRule(theRecords)
	tell application id "DNtp"
		repeat with thisRecord in theRecords
			set parentRecord to location group of thisRecord
			repeat with theProperty in pProperties
				set theValue to get custom meta data for theProperty from parentRecord
				add custom meta data theValue for theProperty to thisRecord
			end repeat
		end repeat
	end tell
end performSmartRule

Did you use AI to generate your script? In this case, did you use DEVONthink’s script assistant (see bottom input field on your screenshot or also Data > New > Script…) and which model and which prompt did you use?

Finally, you might have a look on DEVONthink’s script suite in the Script Editor.app for additional notes and examples: