I haven't really had the time to look any further into this, but if I understand Cassies code right, this bit gets the charmancer data and values for any attributes set. For example if I have a slide named "importer" and it contains an input called "comp_character_name", it is now stored in "mancerValues".
on("mancerfinish:apply", () => {
const mancerData = getCharmancerData();
const mancerValues = mancerData["importer"].values;
Then comes this bit, which I don't understand, but suspect is specfic to the importer:
Object.keys(mancerValues).forEach((key) => {
if (key == "builder" || key == "jsonData" || key == "hidden") {
//delete mancerValues[key];
};
});
clean();
And finally this bit, which I think writes attributes in the "mancerValues" from the comp_ to attr_ so that the character_name should now appear as an attribute on the character sheet:
setAttrs(mancerValues, () => {
console.log(`%c APPLY IMPORTER:`, "color: blue; font-weight:bold");
console.log(mancerValues);
deleteCharmancerData(["importer"]);
finishCharactermancer();
});
});
I've tried simply running Cassies script, both with and without the the bit in the middle, without any luck. It does not finnish, does not delete any data from the Charactermancer or write any data to the attributes on the character sheet.
Again, I realize I'm out of my depth here...