function saveSODFile(){
    if(case_data.locked && !lockedByMe){
        w2alert("Cannot save. File locked by another analyst." );
        return
    }
    syncAllChanges()
    case_data.storage_format_version=storage_format_version
    if(currentfile == "") {
        const {remote} = require('electron')
        const {dialog} = remote
        const selectedPaths = dialog.showSaveDialog({filters: [{name: "Case File", extensions: ["fox"]}]});
        if (selectedPaths == undefined) {

            w2alert('Could not save case.');
            return false

        }
        currentfile = selectedPaths
    }

    var fs = require("fs");
    w2utils.lock($( "#main" ),"Saving file...",true)
    var buffer = new Buffer.from(JSON.stringify(case_data,null, "\t"));
    fs.writeFileSync(currentfile.toString(), buffer);
    w2utils.unlock($( "#main" ))
    var today = new Date();
    var time=('0'  + today.getHours()).slice(-2)+':'+('0'  + today.getMinutes()).slice(-2)+':'+('0' + today.getSeconds()).slice(-2);

    w2ui.sidebar.bottomHTML = '<div id="lock" style="background-color: #eee; padding: 10px 5px; border-top: 1px solid silver">'+lockstate+'</div>'
    w2ui.sidebar.refresh()

    return true
}
Saves file to drive or share