Hi,
I use a node to read a folder with sub-folders. Now I can see my 2k images not very well placed thanks to photos.app…
I would like to move all the files to a simple / single folder. So they are all in one space.
I tried to add a node write, specify a folder but it keeps the sub-folder structure.
How can I ignore the structure ?
Thank you
I am still interesting to find the solution with retrobatch, but I used a bash code to do it before the answer
cd your/folder/
find . -mindepth 2 -type f -exec echo mv {} . \; (dry run)
find . -mindepth 2 -type f -exec mv {} . \; (run)
ccgus
December 29, 2024, 7:40pm
3
I have an unofficial way to do this, using a private Retrobatch JS API.
You can add a JavaScript node after the read folder node and set the contents of the node to the following:
function processAsset(document, jsnode, asset) {
asset.setOutputSubFolder(null);
return true;
}
I’ll also attach a sample workflow:
RemoveSubfolderInfo.retrobatch (2.2 KB)
That should do the trick for now, though it might break in the future (it’s considered a private API, but I’ll try and add something equivalent to the API set at some point).
Thank you so much for your quick answer
It makes me think of n8n and the node Code. Great idea !
For the write node, it might be good to have a checkbox that says : “Ignore subfolder structure” for example.
Best,
Joffrey