Document, jsnode, asset API?

Hello! New to Retrobatch. I like what I see! Is there an API for document, jsnode, and asset in the JS node callbacks? How can I read specific properties like lat/long in EXIF? The examples are a good start:

but is there any way to explore what’s available?

Thanks much!

I’m still working on the JavaScript reference. I’m also in the progress of making a new interface for it, so you can write custom nodes in JavaScript, instead of pasting JS into a specific node…

At any rate- I’ve just added a public API to the latest version of Retrobatch for getting and setting metadata values in JavaScript. Here’s what it looks like:

function processAsset(document, jsnode, asset) {
    // List all values and keys. asset.metaData() returns a dictionary.
    // Or retrieve a specific metadata value.
    console.log(asset.metaValueForPropertyName_inMetaDictionaryName_("CopyrightNotice", "{IPTC}"));
    console.log(asset.metaValueForPropertyName_inMetaDictionaryName_("ColorModel", null));
    // Or set a value:
    asset.setMetaValue_forPropertyName_inMetaDictionaryName_("(c) Flying Meat Inc", "CopyrightNotice", "{IPTC}");
    return true;

You’ll need the latest build of Retrobatch to use it:

If you’d like to use the newer interface I’m working on (scheduled for v1.2), I’ve got an example on this forum post: Sort by aspect ratio

I think once I finish this up, it’ll be the way to go.

1 Like

That’ll work! And I like the plugin concept as well. :rocket:

We’ve got some new documentation available online now:

Feedback is always welcome.