Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 5713 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

Sorry for my ignorance and (somewhat) obvious inexperience when it concerns working with Filemaker, but is it possible to automatically extract the metadata info (author, creator, title, etc) from hundreds of pdf files into filemaker fields?

Posted

There is also AppleScript, which you can run via the Perform AppleScript step, to run the shell command mdls. This is like Spotlight uses (I think). It is fairly simple to get ALL the metadata, but it's a big text block. You can also specify which piece you want, by using the -name option.

Unfortunately the only example file I have is for movie files, which have a lot of different stuff. There are more metadata tags available in Leopard I believe, but like you I'm still on Tiger. So here are basic AppleScript examples, which you could run in the Script Editor app, to see what you can get.


-- This is the general metadata you can get from a file. Remove --comments to run do shell script lines



set file_alias to choose file with prompt "Get the metadata of a file:" without invisibles

set unix_file to quoted form of POSIX path of file_alias



do shell script "/usr/bin/mdls " & unix_file

-- all metadata for chosen file



-- you can also get a named element

-- do shell script "/usr/bin/mdls -name kMDItemContentType " & unix_file



-- but you need to cut it out

-- do shell script "/usr/bin/mdls -name kMDItemContentType " & unix_file & " | tail -1 | cut -d = -f 2 | cut -c 2-"



-- do shell script "/usr/bin/mdls -name kMDItemWhereFroms " & unix_file & " | tail -n +2 | cut -d = -f 2 | cut -c 2-"

-- download URLs, can be several several lines 

This topic is 5713 days old. Please don't post here. Open a new topic instead.

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...

Important Information

By using this site, you agree to our Terms of Use.