Create set list of custom meta data field from files

Dear team, I have a bunch of files named as the name of the organisation in a group. How can I create set list in custom meta data field from those files please? Thank you.

If the number of such files is sufficiently large as to render manual input impractical, try this script:

-- Successfully tested with a small group of documents.
-- This script should be run from DT's scripts menu. Make sure that DT has permission to use System Events.
-- Before you run this script, (1) created a new custom metadata set, (2) create a new entry in Values, and (3) make sure your cursor stays in the input field of the entry!

property groupUUID : "19255B78-86CE-4D8D-9094-183FEF6D973D" -- use the UUID of your group hosting all those documents

tell application id "DNtp"
	set theGroup to get record with uuid groupUUID
	set theDocuments to children of theGroup
	if theDocuments is {} then return
	set theList to {}
	repeat with theItem in theDocuments
		set end of theList to (name of theItem)
	end repeat
	delay 5
	my CreateNewMetadataSet(theList)
end tell

on CreateNewMetadataSet(aList)
	tell application "System Events"
		repeat with a from 1 to length of aList
			delay 0.5
			set the clipboard to (item a of aList) as text
			keystroke "v" using command down
			delay 0.5
			keystroke return
		end repeat
	end tell
end CreateNewMetadataSet
1 Like

While an admirable attempt, note System Events are fragile and often unreliable.

@dissander: Provide more infomation, including screen captures, when making such requests. Thanks.

1 Like