Jump to content

Get Value of kMDItemDisplayName


Recommended Posts

Hi There,

 

Is there a way to get expose the value of `kMDItemDisplayName` in a workflow?

 

I have a file filter from which I'm trying to extract the value of `kMDItemDisplayName` so I can output a markdown link on the pasteboard.

 

It's exposed in the title field of the results, but there doesn't seem to be a programmatic way to access it? I looked through the Automation Tasks and couldn't find anything. Also looked through the documentation under dynamic placeholders (would be great if file metadata could be exposed this way). I can't use `{query} ` as it returns a path and the filename is a uuid.

 

Thanks

 

image.png.20fbfbffbb3a24718e97271a31b3350a.png

 

 

 

Link to comment

Figured this out using mdls:

 

mdls -raw -name kMDItemDisplayName $itempath

# where item path is an alfred variable that outputs a path from a file filter

 

I'm using it in a workflow related to Devonthink to act on recent documents added to my database:

 

ScreenShot2023-02-08at10_40_53AM.thumb.png.ee97dfe8b48b27cd5f990462f139ecca.png

 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...