When you drive down a one-way
cul-de-sac, then there only two ways out a) dig a hole to sleep in, pop your head up every few months in the hope that the city planners will see the madness of one-way cul-de-sacs or b) sprout wings (write a script), or call for an airlift (commission someone to write a script), to get you out of there
You seem to have chosen option a).
It's too late for you to do what I did, after nudging into that same o-w c-d-s, I slammed the motor into reverse saying 'Cor, that's not the way to Dublin', and backed myself out of there, toot-toot (sweet) :lol:
My method, workaround if you insist, involves zero scripting - all done with a file manager and calibre library manager. At no stage are the library folders & files out of whack with the database - i.e. no library integrity comprises. And calibre doesn't do a darn thing with my .FMT_ORIG files, except move them when needs must.
The term Whingeing Pom comes to mind. Brit down under here. Looks like we're for some Aussie's Bragging Boorishly, might need to dig a hole to hide in for a week or two Ψ²
BR