   setTimeout(function() { a.click() }, 20);
    } catch (e) {
        contentsDiv.innerText = "File could not be saved. It might be too large.\nTry splitting into multiple files instead.\n\n" + e;
        console.log("Error saving: " + e);
    }
}

let lastfile = null;
function loadfile()
{
    if(!lastfile)
    {
        return;
    }
    const replace_existing = (document.getElementById('appendfile').value=="0");
    const merge_existing = (document.getElementById('appendfile').value=="1")