How to prevent "Include images in subfolders" to write output to subfolders?

How can I change that reading images in subfolders results in the files to be written in subfolders with the same name?
I want all files to be written into one folder, not each one in a subfolder with the name of the folder where an image originated from.

Currently (write images node with File Name set to token File Name):

/origin/foo/xxx.pdf => /destination/foo/xxx-cover.png
/origin/bar/yyy.pdf => /destination/bar/yyy-cover.png

What I want to achieve:

/origin/foo/xxx.pdf => /destination/xxx-cover.png
/origin/bar/yyy.pdf => /destination//yyy-cover.png

There’s not a built in way to do it, but it’s a quick workaround for now (and specifically for 1.1 only).

Add a JavaScript node, and replace the standard script with this one:

function processAsset(document, jsnode, asset) {
    asset.setOutputSubFolder(null)    
    return true;
}

You can get the Retrobatch 1.1 beta from here: Latest Builds from Flying Meat

1 Like

Thanks a lot. Works perfect.

There should be an option for this or you could include some named script presets. :slight_smile: