Automate parsing in Scrivener (Applescript?)

I would like to parse document titles to extract metadata (in my case, I have book titles and authors for the title, but want to create an “author” metadata field). Is that possible?

It would be easy with Applescript support, which I see has been on the “todo” list since at least 2007. IS there applescript support in Scrivener?

No Applescript support. But the Scrivener project is clearly laid out using easy-to-parse XML, so if you don’t mind getting your hands a bit dirty, just parse the .scrivx file to get the project structure, titles, and any custom metadata. Each document or folder in the binder has a unique ID, and you can extract out mostly anything you’d need. XML has a bunch of nice tools like XPath that are supported in much nicer programming languages than the utter awfulness that is Applescript…

Note, playing around inside the project bundle (Scrivener files are just special folders of files) is not “officially” supported, but if all you need to do is read the data, I can’t see there being any problems…

Make sure you have a good backup, and don’t expect us to help if you mangle the project.

But really any kind of read-only access should be fine. I poke around inside projects for support purposes pretty often and haven’t had an issue.