How to use XMP keywords?

Is there a way to use in DTP (for smart groups or rules) the XMP keywords of a file (for instance saved by NeoFinder)?

This was about writing them but maybe you want to take a look at this thread

Thank you @pete31!

I had a look at this thread before posting my question but actually I was wondering if there is a way to access the XMP keywords directly, without having to convert them to tags…

What exactly do you want to do?

Such wildcards are not supported, you have to specify at least some characters or numbers. E.g. *[a-z0-9]*

1 Like

Yes, found that out.

In case you want to use them in a script

-- Get keywords and "do something"

tell application id "DNtp"
	try
		set theRecords to selection of viewer window 1
		if theRecords = {} then error "Nothing selected."
		
		repeat with thisRecord in theRecords
			set theMetaData to meta data of thisRecord
			set theKeywords to my textItemDelimiters(KMDItemKeywords of theMetaData, "," & linefeed)
			if theKeywords ≠ {} then
				
				-- do something 
				
			end if
		end repeat
		
		
	on error error_message number error_number
		if the error_number is not -128 then display alert "DEVONthink" message error_message as warning
		return
	end try
end tell

on textItemDelimiters(theText, theDelimiter)
	set d to AppleScript's text item delimiters
	set AppleScript's text item delimiters to theDelimiter
	set TextItems to text items of theText
	set AppleScript's text item delimiters to d
	return TextItems
end textItemDelimiters

1 Like

I would like to search for all the files in a database with the XMP keyword “Certificate” for instance, or to be able to create a smart group based on this criteria…

The condition Keywords matches Certificate should be sufficient.

Sorry, I thought you wanted to access and do something with them :slight_smile:

For sure I’m doing something wrong, but if you look at the 1st screenshot (NeoFinder), the file has been saved with the keyword “Formation|Attestation de participation”.

However in DTP the same indexed file has no keyword…

Any clue?

Does the standard Finder from Apple show these keywords?

How are you applying XMP metadata to Affinity Designer files?

@BLUEFROG: while selecting the file in NeoFinder: Item > Metadata > Update metadata

@chrillek: how can I see the keywords in the Finder? I only see the tags while using Get Info…

Could you please zip such a file and send it to cgrunenberg - at - devon-technologies.com? Thanks in advance!

See here:
https://www.lifewire.com/use-spotlight-keyword-searches-to-find-files-2260809
I suppose that xmp keywords are not propagated to the finder so that DT might not see them.

Thanks for your suggestions guys!

They help me understand what’s going on: when it saves keywords for a file other than a jpeg, NeoFinder creates a .XMP “sidecar file” that contains those keywords.

Is there a way to manage these “sidecar files” from DTP?

Is there an option in NeoFinder to write XMP directly to the files?

Just send an image plus its XMP file to cgrunenberg - at - devon-technologies.com and I’ll have a look at it.

You should have received the files Christian.

1 Like